CiscoDevNet / python_code_samples_network

A collection of Python Code Samples for Network Management. Includes samples to run on-box and off-box.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NameError: name 'args' is not defined

dgoodson12722 opened this issue · comments

When executed from idle(python v 3.6.4)
========================= RESTART: /root/updateip.py =========================
The router has the following interfaces:

  • GigabitEthernet1
  • GigabitEthernet2
  • GigabitEthernet3
  • Loopback100

Which Interface do you want to configure? GigabitEthernet2
Traceback (most recent call last):
File "/root/updateip.py", line 181, in
sys.exit(main())
File "/root/updateip.py", line 162, in main
selected_interface = interface_selection(interfaces)
File "/root/updateip.py", line 128, in interface_selection
while sel == args.interface or not sel in [intf["name"] for intf in interfaces]:
NameError: name 'args' is not defined

or

The router has the following interfaces:

  • GigabitEthernet1
  • GigabitEthernet2
  • GigabitEthernet3
  • Loopback100

Which Interface do you want to configure? 2
Traceback (most recent call last):
File "/root/updateip.py", line 181, in
sys.exit(main())
File "/root/updateip.py", line 162, in main
selected_interface = interface_selection(interfaces)
File "/root/updateip.py", line 128, in interface_selection
while sel == args.interface or not sel in [intf["name"] for intf in interfaces]:
NameError: name 'args' is not defined

This appears to have been fixed already. Thanks for reporting.