From e86f96d16d064acf43fbc8bdfd73c15dbdf1607f Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 2 Oct 2018 02:26:42 -0700 Subject: [PATCH] Exit more gracefully when the action command isn't "up" --- connection-specific-ssh-config | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/connection-specific-ssh-config b/connection-specific-ssh-config index f08b132..aa5fe63 100755 --- a/connection-specific-ssh-config +++ b/connection-specific-ssh-config @@ -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")