Catch and raise the exception when GetSession Fails.
authorStephen Soltesz <soltesz@cs.princeton.edu>
Thu, 20 Aug 2009 20:26:22 +0000 (20:26 +0000)
committerStephen Soltesz <soltesz@cs.princeton.edu>
Thu, 20 Aug 2009 20:26:22 +0000 (20:26 +0000)
Then start sshd and stop BootManager immediately so that only one message goes to the user

source/BootAPI.py
source/BootManager.py
source/Exceptions.py

index d69755b..6d16967 100644 (file)
@@ -79,8 +79,8 @@ def create_auth_structure( vars, call_params ):
             auth = auth_session
 
         except Exception, e:
-            print e
-            pass
+            # NOTE: BM has failed to authenticate utterly.
+            raise BootManagerAuthenticationException, "%s" % e
 
     return auth
 
index 40f7b56..370044f 100755 (executable)
@@ -293,6 +293,12 @@ class BootManager:
             self.LOG.write( "\n\nKeyError while running: %s\n" % str(e) )
         except BootManagerException, e:
             self.LOG.write( "\n\nException while running: %s\n" % str(e) )
+        except BootManagerAuthenticationException, e:
+            self.LOG.write( "\n\nFailed to Authenticate Node: %s\n" % str(e) )
+            # sets /tmp/CANCEL_BOOT flag
+            StartDebug.Run(self.VARS, self.LOG )
+            # Return immediately b/c any other calls to API will fail
+            return success
         except:
             self.LOG.write( "\n\nImplementation Error\n")
             traceback.print_exc(file=self.LOG.OutputFile)
index 9fa5301..be4587e 100644 (file)
@@ -13,3 +13,9 @@ class BootManagerException(Exception):
     def __str__( self ):
         return self.__fault
     
+class BootManagerAuthenticationException(Exception):
+    def __init__( self, err ):
+        self.__fault= err
+
+    def __str__( self ):
+        return self.__fault