napalm-automation / napalm-nxos

Apache License 2.0
9 stars 21 forks source link

napalm-nxos SSH re-writes contents of source file when using load_replace_candidate #149

Closed ktbyers closed 7 years ago

ktbyers commented 7 years ago

It was that discovered that napalm-nxos when using SSH re-writes the contents of the source config file when performing a load_replace_candidate operation.

This causes the size of the source file to double on each call of load_replace_candidate() if using an external file and if you are using SSH.

This error was caused by a failed attempt to overwrite the file. In other words, instead of completely re-writing the file, the file was just appended to at the end.

This issue is mitigated by the fact that NX-OS when performing replace operations will eliminate duplicate config commands for both the compare_config() and commit_config() operations. This is also why the issue wasn't detected in testing.