【发布时间】:2020-03-31 06:53:41
【问题描述】:
大家好,我的代码有问题,它没有运行:
from napalm import get_network_driver
driver = get_network_driver('ios')
device = driver('192.168.112.130', 'abc', '123')
device.open()
device.load_merge_candidate(filename='IOSConfig.txt')
print(device.compare_config())
if len(device.compare_config()) > 0:
choice = input('\nWould you like commit these changes? [y/n]: ')
if choice == 'y':
print('Committing ...')
device.commit_config()
else:
print('Discarding ...')
device.discard_config()
else:
print('No difference')
# close the session with the device.
device.close()
print('Done.')
错误是: AttributeError:“NoneType”对象没有属性“组”
【问题讨论】:
-
欢迎来到 Stack Overflow。请提供MVCE,包括您的错误的回溯。目前,我们甚至无法猜测问题所在。
-
minimal reproducible example 和完整匹配的回溯-如果您希望至少得到任何帮助...