コード例 #1
0
    def __init__(self):
        """
        Create a new firstboot Module for the 'register' screen.
        """
        super(moduleClass, self).__init__()

        dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
        GLib.threads_init()
        dbus.mainloop.glib.threads_init()

        self.mode = constants.MODE_REGULAR
        self.title = _("Subscription Management Registration")
        self.sidebarTitle = _("Subscription Registration")
        self.priority = 200.1

        # NOTE: all of this is copied form former firstboot_base module
        # and may no longer be needed
        # set this so subclasses can override behaviour if needed
        self._is_compat = False

        reg_info = registergui.RegisterInfo()
        self.backend = managergui.Backend()
        self.plugin_manager = inj.require(inj.PLUGIN_MANAGER)
        self.register_widget = registergui.FirstbootWidget(
            self.backend, reg_info)
        self.register_widget.connect("notify::screen-ready",
                                     self._on_screen_ready_change)

        # Will be False if we are on an older RHEL version where
        # rhn-client-tools already does some things so we don't have to.
        self.standalone = True
        distribution = HardwareCollector().get_distribution()
        log.debug("Distribution: %s" % str(distribution))

        try:
            dist_version = float(distribution[1])
            # We run this for Fedora as well, but all we really care about here
            # is if this is prior to RHEL 7, so this comparison should be safe.
            if dist_version < 7:
                self.standalone = False
        except Exception as e:
            log.error("Unable to parse a distribution version.")
            log.exception(e)
        log.debug("Running standalone firstboot: %s" % self.standalone)

        self.manual_message = None

        self._skip_apply_for_page_jump = False
        self._cached_credentials = None
        self._registration_finished = False

        self.interface = None
        self.finished = False

        self.proxies_were_enabled_from_gui = None
        self._apply_result = constants.RESULT_FAILURE

        self.page_status = constants.RESULT_FAILURE
コード例 #2
0
    def initialize(self):
        NormalSpoke.initialize(self)
        self._done = False

        init_dep_injection()

        facts = inj.require(inj.FACTS)

        backend = managergui.Backend()
        self.info = registergui.RegisterInfo()
        self.info.connect('notify::register-status',
                          self._on_register_status_change)
        self._status = self.info.get_property('register-status')

        self.register_widget = registergui.RegisterWidget(
            backend, facts, reg_info=self.info, parent_window=self.main_window)

        self.register_box = self.builder.get_object("register_box")
        self.button_box = self.builder.get_object('navigation_button_box')
        self.proceed_button = self.builder.get_object('proceed_button')
        self.back_button = self.builder.get_object('back_button')

        self.register_box.pack_start(self.register_widget.register_widget,
                                     True, True, 0)

        # Hook up the nav buttons in the gui
        # TODO: add a 'start over'?
        self.proceed_button.connect('clicked',
                                    self._on_register_button_clicked)
        self.back_button.connect('clicked', self._on_back_button_clicked)

        # initial-setup will likely
        self.register_widget.connect('finished', self._on_finished)
        self.register_widget.connect('register-finished',
                                     self._on_register_finished)
        self.register_widget.connect('register-error', self._on_register_error)
        self.register_widget.connect('register-message',
                                     self._on_register_message)

        # update the 'next/register button on page change'
        self.register_widget.connect('notify::register-button-label',
                                     self._on_register_button_label_change)

        self.register_widget.connect('notify::screen-ready',
                                     self._on_register_screen_ready_change)

        self.register_box.show_all()
        self.register_widget.initialize()
        self.back_button.set_sensitive(False)
コード例 #3
0
    def __init__(self):
        """
        Create a new firstboot Module for the 'register' screen.
        """
        super(moduleClass, self).__init__()

        self.mode = constants.MODE_REGULAR
        self.title = _("Subscription Management Registration")
        self.sidebarTitle = _("Subscription Registration")
        self.priority = 200.1

        # NOTE: all of this is copied form former firstboot_base module
        # and may no longer be needed
        # set this so subclasses can override behaviour if needed
        self._is_compat = False

        reg_info = registergui.RegisterInfo()
        self.backend = managergui.Backend()
        self.plugin_manager = inj.require(inj.PLUGIN_MANAGER)
        self.register_widget = registergui.FirstbootWidget(
            self.backend, Facts(), reg_info)
        self.register_widget.connect("notify::screen-ready",
                                     self._on_screen_ready_change)

        # Will be False if we are on an older RHEL version where
        # rhn-client-tools already does some things so we don't have to.
        self.standalone = True
        distribution = Hardware().get_distribution()
        log.debug("Distribution: %s" % str(distribution))

        try:
            dist_version = float(distribution[1])
            # We run this for Fedora as well, but all we really care about here
            # is if this is prior to RHEL 7, so this comparison should be safe.
            if dist_version < 7:
                self.standalone = False
        except Exception, e:
            log.error("Unable to parse a distribution version.")
            log.exception(e)