X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=source%2FBootManager.py;h=370044fb4279a0dcba44fc6330e3536b4d47f39b;hb=fedd02d122a4e365b3c02059b55440b6c1a27f03;hp=7460fd8b13b26fbcd01107a8ec411181d280561b;hpb=4eea76a0545774fae808b29d94227be100872bf7;p=bootmanager.git diff --git a/source/BootManager.py b/source/BootManager.py index 7460fd8..370044f 100755 --- a/source/BootManager.py +++ b/source/BootManager.py @@ -169,14 +169,13 @@ class BootManager: at the top of each of the invididual step functions. """ - def _nodeNotInstalled(): + def _nodeNotInstalled(message='MSG_NODE_NOT_INSTALLED'): # called by the _xxxState() functions below upon failure self.VARS['RUN_LEVEL']= 'failboot' + notify = getattr(notify_messages, message) self.VARS['STATE_CHANGE_NOTIFY']= 1 - self.VARS['STATE_CHANGE_NOTIFY_MESSAGE']= \ - notify_messages.MSG_NODE_NOT_INSTALLED - raise BootManagerException, \ - notify_messages.MSG_NODE_NOT_INSTALLED + self.VARS['STATE_CHANGE_NOTIFY_MESSAGE']= notify + raise BootManagerException, notify def _bootRun(): # implements the boot logic, which consists of first @@ -193,13 +192,20 @@ class BootManager: pass InstallInit.Run( self.VARS, self.LOG ) - if ValidateNodeInstall.Run( self.VARS, self.LOG ): + ret = ValidateNodeInstall.Run( self.VARS, self.LOG ) + if ret == 1: WriteModprobeConfig.Run( self.VARS, self.LOG ) MakeInitrd.Run( self.VARS, self.LOG ) WriteNetworkConfig.Run( self.VARS, self.LOG ) CheckForNewDisks.Run( self.VARS, self.LOG ) SendHardwareConfigToPLC.Run( self.VARS, self.LOG ) ChainBootNode.Run( self.VARS, self.LOG ) + elif ret == -1: + _nodeNotInstalled('MSG_NODE_FILESYSTEM_CORRUPT') + elif ret == -2: + _nodeNotInstalled('MSG_NODE_MOUNT_FAILED') + elif ret == -3: + _nodeNotInstalled('MSG_NODE_MISSING_KERNEL') else: _nodeNotInstalled() @@ -287,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)