Skip to content

Commit

Permalink
Gracefully close the SSH session
Browse files Browse the repository at this point in the history
  • Loading branch information
ktbyers committed Jan 17, 2016
1 parent 34937ce commit 0ccab2b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions netmiko/ssh_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,10 @@ def exit_enable_mode(self, exit_command='disable'):
if self.check_enable_mode():
raise ValueError("Failed to exit enable mode.")
return output

def cleanup(self):
'''
Gracefully exit the SSH session.
'''
self.exit_config_mode()
self.remote_conn.sendall("exit\n")

0 comments on commit 0ccab2b

Please sign in to comment.