napalm-automation-community / napalm-ros

MikroTik RouterOS NAPALM driver
104 stars 39 forks source link

napalm_ros.query error #99

Closed SerhiiZahuba closed 2 years ago

SerhiiZahuba commented 2 years ago

After updating the module, I get an error related to napalm_ros.query . But I can't find the napalm_ros.query module.

`` (venv) [root@Inventory netbox]# napalm --user admin --vendor napalm_ros 91.1.1.1 call get_config Enter password: 2022-07-25 19:09:10,286 - napalm - ERROR - get_network_driver - Failed: No module named 'napalm_ros.query'

================= Traceback =================

Traceback (most recent call last): File "/opt/netbox/venv/bin/napalm", line 8, in sys.exit(main()) File "/opt/netbox/venv/lib/python3.9/site-packages/napalm/base/clitools/cl_napalm.py", line 308, in main run_tests(args) File "/opt/netbox/venv/lib/python3.9/site-packages/napalm/base/clitools/cl_napalm.py", line 268, in run_tests driver = call_get_network_driver(args.vendor) File "/opt/netbox/venv/lib/python3.9/site-packages/napalm/base/clitools/cl_napalm.py", line 27, in wrapper r = func(*args, **kwargs) File "/opt/netbox/venv/lib/python3.9/site-packages/napalm/base/clitools/cl_napalm.py", line 170, in call_get_network_driver return get_network_driver(vendor) File "/opt/netbox/venv/lib/python3.9/site-packages/napalm/base/init.py", line 95, in get_network_driver raise e File "/opt/netbox/venv/lib/python3.9/site-packages/napalm/base/init.py", line 86, in get_network_driver module = importlib.import_module(module_name) File "/usr/local/lib/python3.9/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1030, in _gcd_import File "", line 1007, in _find_and_load File "", line 986, in _find_and_load_unlocked File "", line 680, in _load_unlocked File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed File "/opt/netbox/venv/lib/python3.9/site-packages/napalm_ros/init.py", line 7, in from napalm_ros.ros import ROSDriver File "/opt/netbox/venv/lib/python3.9/site-packages/napalm_ros/ros.py", line 37, in from napalm_ros.query import ( ModuleNotFoundError: No module named 'napalm_ros.query'

luqasz commented 2 years ago

Module is here.

Provide information about:

USE issue report template. It's is for a good reason.

SerhiiZahuba commented 2 years ago

Thank you. I'm sorry. Added information below.

napalm version - 4.0.0 napalm-ros - 1.0.1 librouteros - 3.2.1

napalm --user admin --vendor napalm_ros 91.1.1.1 call get_config

Now I'm getting another error

{ "running": "expected end of command (line 1 column 14)\n", "candidate": "expected end of command (line 1 column 14)\n", "startup": "expected end of command (line 1 column 14)\n" }

luqasz commented 2 years ago

napalm-ros with get_config() isn't released yet so how did you execute get_config ?

SerhiiZahuba commented 2 years ago

I copied all your changes to get_config. I thought it would work. If you have information - please write when the new version will be released.

luqasz commented 2 years ago

It's released.

SerhiiZahuba commented 2 years ago

after update to 1.1.0 i see an erorr

Enter password: { "running": "expected end of command (line 1 column 14)\n", "candidate": "expected end of command (line 1 column 14)\n", "startup": "expected end of command (line 1 column 14)\n" }

luqasz commented 2 years ago

Which version of routeros are you running on destination host ?

SerhiiZahuba commented 2 years ago

6.48.5

luqasz commented 2 years ago

Does /export terse work for you in regular ssh session ?

SerhiiZahuba commented 2 years ago

Yes. Works.

luqasz commented 2 years ago

Hmm. Try to modify https://github.com/napalm-automation-community/napalm-ros/blob/master/napalm_ros/ros.py#L372 and set

command = "/export terse"

note /

SerhiiZahuba commented 2 years ago

did not help

Enter password: 
{
    "running": "expected end of command (line 1 column 15)\n",
    "candidate": "expected end of command (line 1 column 15)\n",
    "startup": "expected end of command (line 1 column 15)\n"
}
luqasz commented 2 years ago

Hmm Then I don't know what's the problem. 🤷

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.