Replies: 1 comment 4 replies
-
You probably should capture the Netmiko session log to see what is going on. NAPALM/Netmiko is expecting there to be a valid merge_config.txt file in your flash file system. def remote_md5(
self, base_cmd: str = "verify /md5", remote_file: Optional[str] = None
) -> str:
"""Calculate remote MD5 and returns the hash.
This command can be CPU intensive on the remote device.
"""
if remote_file is None:
if self.direction == "put":
remote_file = self.dest_file
elif self.direction == "get":
remote_file = self.source_file
remote_md5_cmd = f"{base_cmd} {self.file_system}/{remote_file}"
dest_md5 = self.ssh_ctl_chan._send_command_str(remote_md5_cmd, read_timeout=300) So it is expecting to execute a and have it look similar to:
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
HI, please help me. i am using router C3660-A3JK9S-M on GNS3 and getting the below error.
import json
from napalm import get_network_driver
v = get_network_driver("ios")
enable = {"secret": "\n"}
conn = v(hostname="192.168.226.138", username="Veera", password="Veera556_",optional_args=enable)
conn.open()
conn.load_merge_candidate(filename="commands.txt")
conn.commit_config()
out = conn.get_interfaces_ip()
out1 = json.dumps(out, indent=4)
print(out1)
conn.close()
output:
Traceback (most recent call last):
File "C:\Users\avita\PycharmProjects\pythonProject\Napalm\test.py", line 9, in
conn.load_merge_candidate(filename="commands.txt")
File "C:\Users\avita\PycharmProjects\pythonProject\venv\Lib\site-packages\napalm\ios\ios.py", line 317, in load_merge_candidate
return_status, msg = self._load_candidate_wrapper(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\avita\PycharmProjects\pythonProject\venv\Lib\site-packages\napalm\ios\ios.py", line 284, in _load_candidate_wrapper
(return_status, msg) = self._scp_file(
^^^^^^^^^^^^^^^
File "C:\Users\avita\PycharmProjects\pythonProject\venv\Lib\site-packages\napalm\ios\ios.py", line 733, in _scp_file
return self._xfer_file(
^^^^^^^^^^^^^^^^
File "C:\Users\avita\PycharmProjects\pythonProject\venv\Lib\site-packages\napalm\ios\ios.py", line 808, in _xfer_file
if transfer.verify_file():
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\avita\PycharmProjects\pythonProject\venv\Lib\site-packages\netmiko\scp_handler.py", line 413, in verify_file
return self.compare_md5()
^^^^^^^^^^^^^^^^^^
File "C:\Users\avita\PycharmProjects\pythonProject\venv\Lib\site-packages\netmiko\scp_handler.py", line 364, in compare_md5
remote_md5 = self.remote_md5()
^^^^^^^^^^^^^^^^^
File "C:\Users\avita\PycharmProjects\pythonProject\venv\Lib\site-packages\netmiko\scp_handler.py", line 386, in remote_md5
dest_md5 = self.process_md5(dest_md5)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\avita\PycharmProjects\pythonProject\venv\Lib\site-packages\netmiko\scp_handler.py", line 359, in process_md5
raise ValueError(f"Invalid output from MD5 command: {md5_output}")
ValueError: Invalid output from MD5 command: %Error computing MD5 hash flash:/merge_config.txt (No such file or directory)
on Router:
Veera1#sh flash:
System flash directory:
File Length Name/status
1 101 merge_config.txt [deleted]
2 59 merge_config.txt [deleted]
3 59 merge_config.txt [invalid checksum]
[416 bytes used, 7863900 available, 7864316 total]
8192K bytes of processor board System flash (Read/Write)
Veera1#erase flash:
Erasing the flash filesystem will remove all files! Continue? [confirm]
Erasing device... eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ...erased
Veera1#sh flash:
System flash directory:
No files in System flash
[0 bytes used, 7864316 available, 7864316 total]
8192K bytes of processor board System flash (Read/Write)
getting the same first flash output when i run the script again.
i am using napalm 4.0.0, netmiko 4.1.2
Beta Was this translation helpful? Give feedback.
All reactions