napalm-automation / napalm-ios

Apache License 2.0
31 stars 40 forks source link

Disable SCP server after tranfer file to device #175

Closed sincerywaing closed 7 years ago

sincerywaing commented 7 years ago
To avoid unnecessary commands being left after deployment, we'd disable scp server before close connection. This is an enhancement for issue#174
sincerywaing commented 7 years ago

174

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.1%) to 70.766% when pulling ed891eed0d82568fd450afa927d6688b037d36fb on sincerywaing:174 into 69db3eb504c74b2c7973e6cd5e2d3183759ff70e on napalm-automation:develop.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.1%) to 70.766% when pulling ed891eed0d82568fd450afa927d6688b037d36fb on sincerywaing:174 into 69db3eb504c74b2c7973e6cd5e2d3183759ff70e on napalm-automation:develop.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-0.1%) to 70.766% when pulling ed891eed0d82568fd450afa927d6688b037d36fb on sincerywaing:174 into 69db3eb504c74b2c7973e6cd5e2d3183759ff70e on napalm-automation:develop.

ktbyers commented 7 years ago

This is by design.

In other words, if you are doing an SCP operation in NAPALM, then NAPALM will ensure you have SCP enabled. It will not disable it.

Your code would have the opposite effect. In other words, if SCP was enabled before NAPALM ran, it would cause it to be disabled.

The solution would be to track before/after state (which I don't think is worth it). Alternatively someone could use an inline transfer. Or they could just disable it manually in their code.