napalm-automation / napalm

Network Automation and Programmability Abstraction Layer with Multivendor support
Apache License 2.0
2.2k stars 546 forks source link

Cannot connect using optional_args "secret" | cisco ios driver #1948

Open wolfgang-azevedo opened 1 year ago

wolfgang-azevedo commented 1 year ago

Description of Issue/Question

Note: Please check https://guides.github.com/features/mastering-markdown/ to see how to properly format your request.

Did you follow the steps from https://github.com/napalm-automation/napalm#faq

(Place an x between the square brackets where applicable)

Setup

napalm version

(Paste verbatim output from pip freeze | grep napalm between quotes below)

napalm==4.1.0
netbox-napalm-plugin==0.1.2

Network operating system version

(Paste verbatim output from show version - or equivalent - between quotes below)

Cisco IOS Software, C1000 Software (C1000-UNIVERSALK9-M), Version 15.2(7)E4, RELEASE SOFTWARE (fc2)

Steps to Reproduce the Issue

OS / Installation Type

            "Labels": {
                "com.docker.compose.project": "netbox-docker",
                "com.docker.compose.service": "netbox-housekeeping",
                "com.docker.compose.version": "2.18.1",
                "netbox.build-reason": "ubuntu",
                "netbox.git-branch": "HEAD",
                "netbox.git-ref": "c9b79ca579c647b6ca7ee805f3621c9079906c21",
                "netbox.git-url": "https://github.com/netbox-community/netbox.git",
                "netbox.last-base-image-layer": "sha256:dbf6a9befcdeecbb8813406afbd62ce81394e3869d84599f19f941aa5c74f3d1",
                "netbox.original-tag": "v3.5.2-2.6.1",
                "org.opencontainers.image.authors": "The netbox-docker contributors.",
                "org.opencontainers.image.created": "2023-05-24T06:05+00:00",
                "org.opencontainers.image.description": "A container based distribution of NetBox, the free and open IPAM and DCIM solution.",
                "org.opencontainers.image.documentation": "https://github.com/netbox-community/netbox-docker/wiki",
                "org.opencontainers.image.licenses": "Apache-2.0",
                "org.opencontainers.image.ref.name": "ubuntu",
                "org.opencontainers.image.revision": "22486fefb5c4cc326bd091abeac5314eb7acd37f",
                "org.opencontainers.image.source": "https://github.com/netbox-community/netbox-docker.git",
                "org.opencontainers.image.title": "NetBox Docker",
                "org.opencontainers.image.url": "https://github.com/netbox-community/netbox-docker",
                "org.opencontainers.image.vendor": "The netbox-docker contributors.",
                "org.opencontainers.image.version": "2.6.1"

image

Error Traceback

Traceback (most recent call last):
  File "/opt/netbox/venv/bin/napalm", line 8, in <module>
    sys.exit(main())
  File "/opt/netbox/venv/lib/python3.10/site-packages/napalm/base/clitools/cl_napalm.py", line 308, in main
    run_tests(args)
  File "/opt/netbox/venv/lib/python3.10/site-packages/napalm/base/clitools/cl_napalm.py", line 269, in run_tests
    optional_args = helpers.parse_optional_args(args.optional_args)
  File "/opt/netbox/venv/lib/python3.10/site-packages/napalm/base/clitools/helpers.py", line 131, in parse_optional_args
    return {
  File "/opt/netbox/venv/lib/python3.10/site-packages/napalm/base/clitools/helpers.py", line 132, in <dictcomp>
    x.split("=")[0]: ast.literal_eval(x.split("=")[1])
  File "/usr/lib/python3.10/ast.py", line 108, in literal_eval
    return _convert(node_or_string)
  File "/usr/lib/python3.10/ast.py", line 107, in _convert
    return _convert_signed_num(node)
  File "/usr/lib/python3.10/ast.py", line 81, in _convert_signed_num
    return _convert_num(node)
  File "/usr/lib/python3.10/ast.py", line 72, in _convert_num
    _raise_malformed_node(node)
  File "/usr/lib/python3.10/ast.py", line 69, in _raise_malformed_node
    raise ValueError(msg + f': {node!r}')
ValueError: malformed node or string on line 1: <ast.BinOp object at 0x7f7ecfab3e50>
ktbyers commented 1 year ago

@wolfgang-azevedo Have you tried to test it outside of Netbox i.e. direcly using napalm cli-tools?

It is really hard for me to tell given the above is a Netbox issue or a NAPALM issue (or a netbox plugin issue).

But basically NAPALM command line tools are saying you are not presenting the arguments properly to NAPALM command line tools. Which points to more of a netbox or netbox-napalm plugin issue.