Skip to content

Commit

Permalink
Update vyos_ssh.py to enter and exit config mode on save (#3296)
Browse files Browse the repository at this point in the history
  • Loading branch information
ovikosta committed Oct 17, 2023
1 parent 11c80ea commit e2135e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion netmiko/vyos/vyos_ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@ def save_config(
self, cmd: str = "save", confirm: bool = False, confirm_response: str = ""
) -> str:
"""Saves Config."""
output = super().save_config(
output = self.config_mode()
output += super().save_config(
cmd=cmd, confirm=confirm, confirm_response=confirm_response
)
output += self.exit_config_mode()
if "Done" not in output:
raise ValueError(f"Save failed with following errors:\n\n{output}")
return output

0 comments on commit e2135e7

Please sign in to comment.