Browse Source

Exit more gracefully when the action command isn't "up"

remotes/github/master^2 v1.1.0
Mike 2 years ago
parent
commit
e86f96d16d
1 changed files with 10 additions and 4 deletions
  1. +10
    -4
      connection-specific-ssh-config

+ 10
- 4
connection-specific-ssh-config View File

@ -52,12 +52,22 @@ class SSHConfiger:
self.complain(s)
raise Exception(s)
def quit(self, s):
#
self.log("Quitting because: " + s)
sys.exit(0)
#
def run(self):
#
self.log("Running for interface \""+ self._action_interface +"\": " + self._action_command)
# Only run if an interface is coming up
if ( self._action_command != "up" ):
self.quit("We don't need to run for action command: " + str(self._action_command))
# Parse the config
self.parse_config()
@ -105,10 +115,6 @@ class SSHConfiger:
#
def determine_ssh_config_name(self):
# Only run if an interface is coming up
if ( self._action_command != "up" ):
return None
#
self.log("Attempting to determine SSH config name")


Loading…
Cancel
Save