Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Small issue with Ubiquity_edge - probably my fault. #39

Closed
SobieskiCodes opened this issue Jun 27, 2019 · 1 comment
Closed

Small issue with Ubiquity_edge - probably my fault. #39

SobieskiCodes opened this issue Jun 27, 2019 · 1 comment

Comments

@SobieskiCodes
Copy link

SobieskiCodes commented Jun 27, 2019

Question

Turned debugging on and added $ to the pattern, its finding it, but timing out after the command.

DEBUG:netdev:Host 192.168.16.1: Reading pattern '>|\#|\$' was found: '\r\nmyname@rtr0:~$ \r\n'
DEBUG:netdev:Host 192.168.16.1: Found Prompt: 'myname@rtr0:~$'
DEBUG:netdev:Host 192.168.16.1: Base Prompt: myname@rtr0
DEBUG:netdev:Host 192.168.16.1: Base Pattern: \(myname@rtr.*?\) (\(.*?\))?[>|\#|\$]
INFO:netdev:Host 192.168.16.1: Entering to privilege exec
INFO:netdev:Host 192.168.16.1: Checking privilege exec
INFO:netdev:Host 192.168.16.1: Reading until pattern
DEBUG:netdev:Host 192.168.16.1: Reading pattern: \(myname@rtr.*?\) (\(.*?\))?[>|\#|\$]
ERROR:asyncio:Task exception was never retrieved
netdev.exceptions.TimeoutError: Host 192.168.16.1 Timeout Error

Any insight? (running the command in ssh/cli works fine so i know its the command thats the issue. (let me know what you need) It looks like it finds the prompt fine but can't seem to read the pattern.

import asyncio
import netdev
import logging


logging.basicConfig(level=logging.INFO)
netdev.logger.setLevel(logging.DEBUG)

async def task(param):
    async with netdev.create(**param) as ubi:
        out = await ubi.send_command("?")
        print(out)



async def run():
    dev = {'username': 'admin',
            'password': 'password',
            'device_type': 'ubiquity_edge',
            'host': '192.168.16.1',
            }
    devices = [dev]
    tasks = [task(dev) for dev in devices]
    await asyncio.wait(tasks)


loop = asyncio.get_event_loop()
loop.run_until_complete(run())
@SobieskiCodes
Copy link
Author

No idea - its working today. Must be something on my end.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant