Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli commands returns NotImplementedError #102

Open
gullanetworkcode opened this issue Jun 18, 2024 · 0 comments
Open

cli commands returns NotImplementedError #102

gullanetworkcode opened this issue Jun 18, 2024 · 0 comments

Comments

@gullanetworkcode
Copy link

Environment

Python version ('python3 --version'): Python 3.10.12

  • Napalm version ('pip show napalm') : 5.0.0
  • Napalm-s350 version ('pip show napalm-s350': 0.5.1
  • Cisco SMB switch model (for example 'SG500-28-K9' or 'SG350X-48P-K9': SF300-24PP-K9
  • Napalm diagnostic output ('napalm --vendor s350 --user USER --debug HOSTNAME':
    paste full output here
    """
    2024-06-18 18:16:01,369 - napalm - DEBUG - Starting napalm's debugging tool
    2024-06-18 18:16:01,369 - napalm - DEBUG - Gathering napalm packages
    2024-06-18 18:16:01,369 - napalm - DEBUG - napalm-s350==0.5.1
    2024-06-18 18:16:01,369 - napalm - DEBUG - napalm==5.0.0
    2024-06-18 18:16:01,369 - napalm - DEBUG - get_network_driver - Calling with args: ('s350',), {}
    2024-06-18 18:16:01,370 - napalm - DEBUG - get_network_driver - Successful
    2024-06-18 18:16:01,370 - napalm - DEBUG - init - Calling with args: (<class 'napalm_s350.s350.S350Driver'>, '10.100.150.101', 'admin'), {'password': '*******', 'timeout': 60, 'optional_args': {'force_no_enable': True}}
    2024-06-18 18:16:01,370 - napalm - DEBUG - init - Successful
    2024-06-18 18:16:01,370 - napalm - DEBUG - pre_connection_tests - Calling with args: (<napalm_s350.s350.S350Driver object at 0x7fa4e05ff910>,), {}
    2024-06-18 18:16:01,370 - napalm - DEBUG - open - Calling with args: (<napalm_s350.s350.S350Driver object at 0x7fa4e05ff910>,), {}
    2024-06-18 18:16:03,117 - napalm - DEBUG - open - Successful
    2024-06-18 18:16:03,117 - napalm - DEBUG - connection_tests - Calling with args: (<napalm_s350.s350.S350Driver object at 0x7fa4e05ff910>,), {}
    2024-06-18 18:16:03,117 - napalm - DEBUG - get_facts - Calling with args: (<napalm_s350.s350.S350Driver object at 0x7fa4e05ff910>,), {}
    2024-06-18 18:16:07,213 - napalm - DEBUG - Gathered facts:
    {
    "fqdn": "Unknown",
    "hostname": "LN-ASX-101",
    "interface_list": [
    "FastEthernet1",
    "FastEthernet2",
    "FastEthernet3",
    "FastEthernet4",
    "FastEthernet5",
    "FastEthernet6",
    "FastEthernet7",
    "FastEthernet8",
    "FastEthernet9",
    "FastEthernet10",
    "FastEthernet11",
    "FastEthernet12",
    "FastEthernet13",
    "FastEthernet14",
    "FastEthernet15",
    "FastEthernet16",
    "FastEthernet17",
    "FastEthernet18",
    "FastEthernet19",
    "FastEthernet20",
    "FastEthernet21",
    "FastEthernet22",
    "FastEthernet23",
    "FastEthernet24",
    "GigabitEthernet1",
    "GigabitEthernet2",
    "GigabitEthernet3",
    "GigabitEthernet4",
    "Port-channel1",
    "Port-channel2",
    "Port-channel3",
    "Port-channel4",
    "Port-channel5",
    "Port-channel6",
    "Port-channel7",
    "Port-channel8"
    ],
    "model": "SF300-24PP-K9",
    "os_version": "1.4.1.3",
    "serial_number": "DNI193508T7",
    "uptime": 172394.0,
    "vendor": "Cisco"
    }
    {
    "fqdn": "Unknown",
    "hostname": "LN-ASX-101",
    "interface_list": [
    "FastEthernet1",
    "FastEthernet2",
    "FastEthernet3",
    "FastEthernet4",
    "FastEthernet5",
    "FastEthernet6",
    "FastEthernet7",
    "FastEthernet8",
    "FastEthernet9",
    "FastEthernet10",
    "FastEthernet11",
    "FastEthernet12",
    "FastEthernet13",
    "FastEthernet14",
    "FastEthernet15",
    "FastEthernet16",
    "FastEthernet17",
    "FastEthernet18",
    "FastEthernet19",
    "FastEthernet20",
    "FastEthernet21",
    "FastEthernet22",
    "FastEthernet23",
    "FastEthernet24",
    "GigabitEthernet1",
    "GigabitEthernet2",
    "GigabitEthernet3",
    "GigabitEthernet4",
    "Port-channel1",
    "Port-channel2",
    "Port-channel3",
    "Port-channel4",
    "Port-channel5",
    "Port-channel6",
    "Port-channel7",
    "Port-channel8"
    ],
    "model": "SF300-24PP-K9",
    "os_version": "1.4.1.3",
    "serial_number": "DNI193508T7",
    "uptime": 172394.0,
    "vendor": "Cisco"
    }
    2024-06-18 18:16:07,213 - napalm - DEBUG - get_facts - Successful
    2024-06-18 18:16:07,214 - napalm - DEBUG - method - Calling with args: (<napalm_s350.s350.S350Driver object at 0x7fa4e05ff910>, 'cli=show arp'), {}
    2024-06-18 18:16:07,214 - napalm - DEBUG - cli=show arp - Attempting to resolve method
    2024-06-18 18:16:07,214 - napalm - ERROR - method - Failed: 'S350Driver' object has no attribute 'cli=show arp'

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

Traceback (most recent call last):
File "/home/paul/Documents/Gulla Networks/code/nornir/nornirenv/bin/napalm", line 10, in
sys.exit(main())
File "/home/paul/Documents/Gulla Networks/code/nornir/nornirenv/lib/python3.10/site-packages/napalm/base/clitools/cl_napalm.py", line 308, in main
run_tests(args)
File "/home/paul/Documents/Gulla Networks/code/nornir/nornirenv/lib/python3.10/site-packages/napalm/base/clitools/cl_napalm.py", line 291, in run_tests
call_getter(device, args.method, **method_kwargs)
File "/home/paul/Documents/Gulla Networks/code/nornir/nornirenv/lib/python3.10/site-packages/napalm/base/clitools/cl_napalm.py", line 27, in wrapper
r = func(*args, **kwargs)
File "/home/paul/Documents/Gulla Networks/code/nornir/nornirenv/lib/python3.10/site-packages/napalm/base/clitools/cl_napalm.py", line 251, in call_getter
func = getattr(device, method)
AttributeError: 'S350Driver' object has no attribute 'cli=show arp'
"""

Steps to Reproduce

  1. Create following script
import napalm
import os
from pprint import pprint as pprint

# Import variables
# Read in username from environment variables and store them as defaults
USERNAME = os.environ['USERNAME']
PASSWORD = os.environ['PASSWORD']

driver = napalm.get_network_driver('s350')
device = driver(hostname='10.100.150.101', username=USERNAME, password=PASSWORD)

commands = ['show arp']

device.open()
pprint(device.cli(commands))
device.close()
  1. Run script

Run cli command and return output

  File "/home/paul/Documents/Gulla Networks/code/nornir/napalmtest.py", line 19, in <module>
    pprint(device.cli(commands))
  File "/home/paul/Documents/Gulla Networks/code/nornir/nornirenv/lib/python3.10/site-packages/napalm/base/base.py", line 769, in cli
    raise NotImplementedError
NotImplementedError```

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

No branches or pull requests

1 participant