Adding file_download and file_upload#338
Conversation
| log.debug("Host %s: File %s does not already exist on remote.", self.host, src) | ||
| return False | ||
|
|
||
| def file_download(self, url, dest="", md5=None, file_system=None, read_timeout=2000): |
There was a problem hiding this comment.
Should we just do **netmiko_kwargs too? Incase you need read_timeout_override or any of the other netmiko kwargs.
| filename, | ||
| ) | ||
|
|
||
| copy_command = f"copy {url} {file_system}{dest}" |
There was a problem hiding this comment.
Wondering if we should construct this with some validation. I'm thinking file_system would be bootflash the dest you'd have to know to do ///image.bin or //something/image.bin. Can we use Path or some other lib to try and construct this more intelligently?
There was a problem hiding this comment.
Even more so around the colon part. Would expect bootflash:///image.bin
| return self.verify_md5(filename, md5, file_system) | ||
|
|
||
| def file_upload(self, filename, url, file_system=None, read_timeout=2000): | ||
| """Upload file to remote server. |
There was a problem hiding this comment.
| """Upload file to remote server. | |
| """Upload local file to remote server. |
| return True | ||
| return self.verify_md5(filename, md5, file_system) | ||
|
|
||
| def file_upload(self, filename, url, file_system=None, read_timeout=2000): |
There was a problem hiding this comment.
perhaps same as before around **netmiko_kwargs
|
We have decided to instead run these through nornir-nautobot via a dispatcher method instead, so I'm going to close this PR. |
creating a PR from this so I can comment.