コード例 #1
0
    def should_run(cls, environment, data):
        """This method is responsible for beginning Spoke initialization
           in the firstboot environment (even before __init__).

           It should return True if the spoke is to be shown
           and False if it should be skipped.

           It might be called multiple times, with or without (None)
           the data argument.
        """

        if environment == ANACONDA_ENVIRON:
            return True

        if environment == FIRSTBOOT_ENVIRON:
            # cannot decide, stay in the game and let another call with data
            # available (will come) decide
            if data is None:
                return True

            # generally run spokes in firstboot only if doing reconfig, spokes
            # that should run even if not doing reconfig should override this
            # method
            return is_reconfiguration_mode()

        return False
コード例 #2
0
ファイル: root_password.py プロジェクト: kkang-wr/anaconda
    def status(self):
        if self._users_module.IsRootAccountLocked:
            # reconfig mode currently allows re-enabling a locked root account if
            # user sets a new root password
            if is_reconfiguration_mode() and not self.root_enabled:
                return _("Disabled, set password to enable.")
            else:
                return _("Root account is disabled.")

        elif self._users_module.IsRootPasswordSet:
            return _("Root password is set")
        else:
            return _("Root password is not set")