1

谁能帮忙?当我尝试使用凝固汽油弹测试一个简单的代码时出现错误。我在 GNS3 上使用了 cisco。我还添加了可选参数(delay_factor),但它得到了同样的错误。

from napalm import get_network_driver

driver = get_network_driver("ios")
others = {
            "secret" : "cisco",
            "dest_file_system" : "nvram:",
            'delay_factor': 5
            }
device = driver(hostname="192.168.124.148", username="cisco", password="cisco", optional_args=others)
device.open()

device.load_merge_candidate(filename="candidate")
compare = device.compare_config()

print(compare)
device.commit_config()

device.close()
Traceback (most recent call last):
  File "c.py", line 16, in <module>
    device.commit_config()
  File "/Users/zakky.muhammad/Downloads/tmp/Env/lib/python3.8/site-packages/napalm/ios/ios.py", line 555, in commit_config
    output += self.device.save_config()
  File "/Users/zakky.muhammad/Downloads/tmp/Env/lib/python3.8/site-packages/netmiko/cisco/cisco_ios.py", line 37, in save_config
    return super(CiscoIosBase, self).save_config(
  File "/Users/zakky.muhammad/Downloads/tmp/Env/lib/python3.8/site-packages/netmiko/cisco_base_connection.py", line 224, in save_config
    output = self.send_command(command_string=cmd)
  File "/Users/zakky.muhammad/Downloads/tmp/Env/lib/python3.8/site-packages/netmiko/base_connection.py", line 1335, in send_command
    raise IOError(
OSError: Search pattern never detected in send_command_expect: R\#
4

0 回答 0