Пример #1
0
    def installSystem(self):
        # resize the display label so that the parent window is not resized off
        # the screen
        # XXX This must be done here since the allocation has not been processed
        # within the __init__ method.  We can not query the allocation of a
        # widget and get a valid value at that point.
        hbox = self.xml.get_widget('InstallstatusHBox')
        label = self.xml.get_widget('InstallationLabel')

        height = self.progressLabel.get_allocation().height
        width = hbox.get_allocation().width - label.get_allocation().width
        self.progressLabel.set_size_request(width, height)

        self.progressBar.set_fraction(0)

        if not userchoices.getClaimedNICDevices():
            MessageWindow(
                self.controlState.gui.getWindow(), 'the end',
                'Because you have no usable (to ESX, so far)\n' +
                'NICs, installation can go no further than this\n' +
                'point, for now.')
            # TODO: remove when we *can* install NIC-less.
            return

        applychoices.doit(self.context)
        self.controlState.setNextButtonEnabled(True, refresh=True)
        self.controlState.setCancelButtonEnabled(False, refresh=True)
        self.controlState.gui.nextButton.grab_focus()
Пример #2
0
    def installSystem(self):
        # resize the display label so that the parent window is not resized off
        # the screen
        # XXX This must be done here since the allocation has not been processed
        # within the __init__ method.  We can not query the allocation of a
        # widget and get a valid value at that point.
        hbox = self.xml.get_widget('InstallstatusHBox')
        label = self.xml.get_widget('InstallationLabel')

        height = self.progressLabel.get_allocation().height
        width = hbox.get_allocation().width - label.get_allocation().width
        self.progressLabel.set_size_request(width, height)

        self.progressBar.set_fraction(0)

        if not userchoices.getClaimedNICDevices():
            MessageWindow( self.controlState.gui.getWindow(), 'the end',
                           'Because you have no usable (to ESX, so far)\n' +
                           'NICs, installation can go no further than this\n' +
                           'point, for now.')
            # TODO: remove when we *can* install NIC-less.
            return

        applychoices.doit(self.context)
        self.controlState.setNextButtonEnabled(True, refresh=True)
        self.controlState.setCancelButtonEnabled(False, refresh=True)
        self.controlState.gui.nextButton.grab_focus()
Пример #3
0
    def apply2(self, stepListType):
        "Apply choices using variant step list"
        previousLevel = stdoutHandler.level
        if _THROTTLE:
            stdoutHandler.setLevel(LOGLEVEL_HUMAN)
        applychoices.doit(self.context, stepListType)
        stdoutHandler.setLevel(previousLevel)

        self.setSubstepEnv({'next': self.stepForward})
Пример #4
0
    def apply(self):
        "Apply choices using default 'install' step list"
        previousLevel = stdoutHandler.level
        if _THROTTLE:
            stdoutHandler.setLevel(LOGLEVEL_HUMAN)
        applychoices.doit(self.context)
        stdoutHandler.setLevel(previousLevel)

        self.setSubstepEnv({'next': self.stepForward})
Пример #5
0
 def applyDrivers(self):
     "Apply choices using 'loadDrivers' step list"
     previousLevel = stdoutHandler.level
     if _THROTTLE:
         stdoutHandler.setLevel(LOGLEVEL_HUMAN)
     try:
         applychoices.doit(self.context, stepListType="loadDrivers")
     except customdrivers.ScriptLoadError, msg:
         ui = {
             'title': "Non-critical Script Loading Failures",
             'body': "%s\n%s" % (refmt(msg[0]), errContinueCancel),
             'menu': {
                 '1': self.continueForward,
                 '!': self.cancel,
             }
         }
         self.setSubstepEnv(ui)
         return
Пример #6
0
    def _execute(self, script):
        from preparser import ScriptedInstallPreparser
        from scriptedinstallutil import Result

        errors = None
        installCompleted = False

        try:
            self.sip = ScriptedInstallPreparser(script)

            (result, errors, warnings) = self.sip.parseAndValidate()
            if warnings:
                log.warn("\n".join(warnings))
            if errors:
                log.error("\n".join(errors))
                userchoices.setReboot(False)
            if result != Result.FAIL:
                # Bring up whatever is needed for the install to happen.  For
                # example, get the network going for non-local installs.
                errors, warnings = self._runtimeActions()

                if warnings:
                    log.warn("\n".join(warnings))
                if errors:
                    log.error("\n".join(errors))
                    userchoices.setReboot(False)

                if not errors:
                    if userchoices.getDebug():
                        log.info(userchoices.dumpToString())

                    if userchoices.getDryrun():
                        log.log(LOGLEVEL_HUMAN, "dry run specified, stopping.")
                    else:
                        context = applychoices.Context(
                            applychoices.ProgressCallback(
                                applychoices.StdoutProgressDelegate()))
                        applychoices.doit(context)
                        installCompleted = True

                media.runtimeActionEjectMedia()
        except IOError, e:
            log.error("error: cannot open file -- %s\n" % str(e))
Пример #7
0
    def _execute(self, script):
        from preparser import ScriptedInstallPreparser
        from scriptedinstallutil import Result

        errors = None
        installCompleted = False

        try:
            self.sip = ScriptedInstallPreparser(script)

            (result, errors, warnings) = self.sip.parseAndValidate()
            if warnings:
                log.warn("\n".join(warnings))
            if errors:
                log.error("\n".join(errors))
                userchoices.setReboot(False)
            if result != Result.FAIL:
                # Bring up whatever is needed for the install to happen.  For
                # example, get the network going for non-local installs.
                errors, warnings = self._runtimeActions()

                if warnings:
                    log.warn("\n".join(warnings))
                if errors:
                    log.error("\n".join(errors))
                    userchoices.setReboot(False)
                
                if not errors:
                    if userchoices.getDebug():
                        log.info(userchoices.dumpToString())

                    if userchoices.getDryrun():
                        log.log(LOGLEVEL_HUMAN, "dry run specified, stopping.")
                    else:
                        context = applychoices.Context(
                            applychoices.ProgressCallback(
                                applychoices.StdoutProgressDelegate()))
                        applychoices.doit(context)
                        installCompleted = True

                media.runtimeActionEjectMedia()
        except IOError, e:
            log.error("error: cannot open file -- %s\n" % str(e))
Пример #8
0
    def loadDrivers(self):
        # resize the display label so that the parent window is not resized off
        # the screen
        # XXX This must be done here since the allocation has not been processed
        # within the __init__ method.  We can not query the allocation of a
        # widget and get a valid value at that point.
        hbox = self.xml.get_widget('DriverloadstatusHBox')
        label = self.xml.get_widget('DriverloadLabel')

        height = self.progressLabel.get_allocation().height
        width = hbox.get_allocation().width - label.get_allocation().width
        self.progressLabel.set_size_request(width, height)

        self.progressBar.set_fraction(0)

        try:
            applychoices.doit(self.context, stepListType='loadDrivers')
            self.controlState.setNextButtonEnabled(True, refresh=True)
        except customdrivers.ScriptLoadError, msg:
            MessageWindow(None, "Script Loading Failures", str(msg[0]))
            self.controlState.setNextButtonEnabled(True, refresh=True)
Пример #9
0
    def loadDrivers(self):
        # resize the display label so that the parent window is not resized off
        # the screen
        # XXX This must be done here since the allocation has not been processed
        # within the __init__ method.  We can not query the allocation of a
        # widget and get a valid value at that point.
        hbox = self.xml.get_widget('DriverloadstatusHBox')
        label = self.xml.get_widget('DriverloadLabel')

        height = self.progressLabel.get_allocation().height
        width = hbox.get_allocation().width - label.get_allocation().width
        self.progressLabel.set_size_request(width, height)

        self.progressBar.set_fraction(0)

        try:
            applychoices.doit(self.context, stepListType='loadDrivers')
            self.controlState.setNextButtonEnabled(True, refresh=True)
        except customdrivers.ScriptLoadError, msg:
            MessageWindow(None, "Script Loading Failures", str(msg[0]))
            self.controlState.setNextButtonEnabled(True, refresh=True)