napalm-ros icon indicating copy to clipboard operation
napalm-ros copied to clipboard

napalm_ros.query error

Open SerhiiZahuba opened this issue 2 years ago • 13 comments

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'


SerhiiZahuba avatar Jul 26 '22 13:07 SerhiiZahuba

Module is here.

Provide information about:

  • napalm version
  • napalm-ros version
  • librouteros version

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

luqasz avatar Jul 26 '22 15:07 luqasz

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" }

SerhiiZahuba avatar Jul 27 '22 06:07 SerhiiZahuba

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

luqasz avatar Jul 29 '22 17:07 luqasz

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.

SerhiiZahuba avatar Jul 30 '22 05:07 SerhiiZahuba

It's released.

luqasz avatar Jul 30 '22 15:07 luqasz

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" }

SerhiiZahuba avatar Jul 31 '22 04:07 SerhiiZahuba

Which version of routeros are you running on destination host ?

luqasz avatar Jul 31 '22 18:07 luqasz

6.48.5

SerhiiZahuba avatar Aug 01 '22 05:08 SerhiiZahuba

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

luqasz avatar Aug 01 '22 14:08 luqasz

Yes. Works.

SerhiiZahuba avatar Aug 01 '22 14:08 SerhiiZahuba

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 /

luqasz avatar Aug 01 '22 16:08 luqasz

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"
}

SerhiiZahuba avatar Aug 03 '22 07:08 SerhiiZahuba

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

luqasz avatar Aug 04 '22 13:08 luqasz

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

stale[bot] avatar Oct 13 '22 21:10 stale[bot]