Ejemplo n.º 1
0
    def ui_content(self):
        sync_mgmt()

        buttons = []
        net_is_configured = utils.network.NodeNetwork().is_configured()
        header_menu = "{engine_name} Configuration".format(
            engine_name=config.engine_name)

        if not net_is_configured:
            ws = [
                ui.Header("header[0]", header_menu),
                ui.Notice(
                    "network.notice", "Networking is not configured, " +
                    "please configure it before " + "registering"),
                ui.Divider("divider[0]")
            ]

        elif self._hosted_engine_configured():
            ws = [
                ui.Header("header[0]", header_menu),
                ui.Notice(
                    "he.notice",
                    "Hosted Engine is configured. Engine registration "
                    "is disabled, as this host is already registered to"
                    " the hosted engine"),
                ui.Divider("divider[0]"),
                ui.Label("vdsm_cfg.password._label",
                         "Password for adding additional hosts"),
                ui.Label(
                    "vdsm_cfg.password._label2",
                    "Note: This sets the root password and "
                    "enables SSH"),
                ui.ConfirmedEntry("vdsm_cfg.password", "Password:"******"action.register", "Save")]

        else:
            ws = [
                ui.Header("header[0]", header_menu),
                ui.Entry("vdsm_cfg.address",
                         str(config.engine_name) + " FQDN (or fqdn:port):"),
                ui.Divider("divider[0]"),
                ui.Label(
                    "vdsm_cfg.password._label",
                    "Optional password for adding Node through " +
                    str(config.engine_name)),
                ui.Label(
                    "vdsm_cfg.password._label2",
                    "Note: This sets the root password and "
                    "enables SSH"),
                ui.ConfirmedEntry("vdsm_cfg.password", "Password:"******"action.register", "Save / Register")]

        page = ui.Page("page", ws)
        page.buttons = buttons

        self.widgets.add(page)
        return page
Ejemplo n.º 2
0
    def ui_content(self):
        ws = [
            ui.Header("header", _("Remote Storage")),
            ui.Entry("iscsi.initiator_name",
                     _("iSCSI Initiator Name:"),
                     align_vertical=True),
            ui.Divider("divider[0]"),
        ]

        net_is_configured = utils.network.NodeNetwork().is_configured()

        if not net_is_configured:
            ws.extend([
                ui.Notice(
                    "network.notice", "Networking is not configured, " +
                    "please configure it before NFSv4 " + "Domain"),
                ui.Divider("notice.divider")
            ])
        ws.extend([
            ui.Entry("nfsv4.domain",
                     _("NFSv4 Domain (example.redhat.com):"),
                     enabled=net_is_configured,
                     align_vertical=True)
        ])

        page = ui.Page("page", ws)
        self.widgets.add(page)
        return page
 def ui_content(self):
     ws = [
         ui.Header("header[0]",
                   _("Require a password for the admin user?")),
         ui.Label(
             "label[0]",
             _("Please enter the current admin ") +
             _("password. You may also change the admin password ") +
             _("if required. If the new password fields are left ") +
             _("blank the password will remain the same.")),
         ui.Label("label[1]", _("Password for the admin user")),
         ui.Divider("divider[0]"),
         ui.PasswordEntry("upgrade.current_password",
                          _("Current Password:"******"divider[1]"),
         ui.ConfirmedEntry("upgrade.password",
                           _("Password:"******"current_password.info", ""),
         ui.Label("password.info", self.__no_new_password_msg)
     ]
     page = ui.Page("password", ws)
     page.buttons = [
         ui.QuitButton("button.quit", "Quit"),
         ui.Button("button.back", "Back"),
         ui.SaveButton("button.next", "Update")
     ]
     self.widgets.add(page)
     return page
Ejemplo n.º 4
0
    def ui_content(self):

        ws = [
            ui.Header("header[0]", _("Logging")),
            ui.Label(
                "logrotate.header",
                _("The logs will be rotated at the ") +
                _("specified size not more often than the ") +
                _("set inerval")),
            ui.Entry("logrotate.max_size",
                     _("Logrotate Max Log ") + _("Size (KB):")),
            ui.Options("logrotate.interval", _("Interval"), self._intervals),
            ui.Divider("divider[0]")
        ]

        net_is_configured = utils.network.NodeNetwork().is_configured()

        if not net_is_configured:
            ws.extend([
                ui.Notice(
                    "network.notice",
                    _("Networking is not configured, ") +
                    _("please configure it before rsyslog ") +
                    _("and/or netconsole")),
                ui.Divider("notice.divider")
            ])

        ws.extend([
            ui.Label(
                "rsyslog.header",
                _("RSyslog is an enhanced multi-") + _("threaded syslogd")),
            ui.Entry("rsyslog.address",
                     _("Server Address:"),
                     enabled=net_is_configured),
            ui.Entry("rsyslog.port",
                     _("Server Port:"),
                     enabled=net_is_configured),
            ui.Divider("divider[1]"),
            ui.Label(
                "netconsole.label",
                _("Netconsole service allows a remote sys") +
                _("log daemon to record printk() messages")),
            ui.Entry("netconsole.address",
                     _("Server Address:"),
                     enabled=net_is_configured),
            ui.Entry("netconsole.port",
                     _("Server Port:"),
                     enabled=net_is_configured)
        ])

        page = ui.Page("page", ws)
        self.widgets.add(page)
        return page
Ejemplo n.º 5
0
    def ui_content(self):
        ws = [ui.Header("header[0]", _("Storage Volumes")),
              ui.KeywordLabel("storage.drive_size", "Drive size: ")]

        if not self.__enough_free_space():
            ws.extend([ui.Notice("space.notice",
                                 "Not enough space! Needs at least "
                                 "%sMB for installation, %sMB "
                                 "available" % (str(self._min_drive_size),
                                                self._drive_size))])

        if not self._fill:
            ws.extend([ui.KeywordLabel("storage.free_space",
                                       "Remaining Space: ")])

        ws.extend([ui.Label("label[0]", "Please enter the sizes for the " +
                            "following partitions in MB"),
                   ui.Checkbox("storage.fill_data", "Fill disk with Data " +
                               "partition", True),
                   ui.Entry("storage.efi_size", _("UEFI/Bios:"),
                            enabled=False),
                   ui.Entry("storage.root_size", _("Root & RootBackup:"),
                            enabled=False),
                   ui.Label("label[1]", _("(2 partitions at %sMB each)") %
                            self.model().get("storage.root_size")),
                   ui.Divider("divider[2]"),
                   ui.Entry("storage.swap_size", _("Swap MB:")),
                   ui.Entry("storage.config_size", _("Config MB:")),
                   ui.Entry("storage.logging_size", _("Logging MB:")),
                   ui.Entry("storage.data_size", _("Data MB:"),
                            enabled=not self._fill),
                   ])

        if not self._fill:
            ws.extend([ui.Label("label[2]", "(-1 fills all free space)")])

        self.widgets.add(ws)
        page = ui.Page("storage", ws)
        page.buttons = [ui.QuitButton("button.quit", _("Quit")),
                        ui.Button("button.back", _("Back"))]

        if self.__enough_free_space():
            can_continue = self.model() and self.__calculate_free_space() >= 0
            page.buttons.extend([ui.SaveButton("button.next",
                                               _("Continue"),
                                               enabled=can_continue)])

        return page
Ejemplo n.º 6
0
    def ui_content(self):
        if self.application.args.dry:
            net_is_configured = True
        else:
            net_is_configured = NodeNetwork().is_configured()

        if not net_is_configured:

            ws = ([
                ui.Divider("notice.divider"),
                ui.Notice(
                    "network.notice", "Networking is not configured, please " +
                    "configure it before configuring RHN"),
                ui.Divider("notice.divider")
            ])

        else:
            status, rhn_type = get_rhn_status()
            if status == 0:
                rhn_msg = ("RHN Registration is required only if you wish " +
                           "to use Red Hat Enterprise Linux with virtual " +
                           "guests subscriptions for your guests.")
            else:
                rhn_msg = "RHN Registration\n\nRegistration Status: %s" \
                          % rhn_type

            ws = [
                ui.Header("header[0]", rhn_msg),
                ui.Entry("rhn.user", "Login:"******"rhn.password", "Password:"******"rhn.profilename", "Profile Name (optional):"),
                ui.Divider("divider[0]"),
                ui.Options("rhn.type", "Type", self._rhn_types),
                ui.Entry("rhn.url", "URL:"),
                ui.Entry("rhn.ca", "CA URL:"),
                ui.Header("header[0]", "HTTP Proxy Configuration"),
                ui.Entry("rhn.proxyhost", "Server:"),
                ui.Entry("rhn.proxyport", "Port:"),
                ui.Entry("rhn.proxyuser", "Username:"******"rhn.proxypassword", "Password:"******"divider[1]"),
            ]

        page = ui.Page("page", ws)
        self.widgets.add(ws)
        return page
Ejemplo n.º 7
0
    def ui_content(self):
        """Describes the UI this plugin requires
        This is an ordered list of (path, widget) tuples.
        """
        # _types needs to be rebuild on every page view, as the network
        # state can change between page views
        # NodeNetwork relies on runtime information which is N/A in dev mode
        if self.application.args.dry:
            net_is_configured = True
        else:
            net_is_configured = NodeNetwork().is_configured()

        ws = [ui.Header("kdump._header", _("Configure Kdump"))]

        if not net_is_configured:
            self._types = self._types_local
            ws.extend([
                ui.Notice(
                    _("network.notice"),
                    _("Networking is not configured, ") +
                    _("please configure it before NFS ") +
                    _("or SSH-based kdump")),
                ui.Divider("notice.divider")
            ])
            ws.extend([ui.Options("kdump.type", _("Type"), self._types)])

        else:
            self._types = self._types_local + self._types_remote
            ws.extend([ui.Options("kdump.type", _("Type"), self._types)])
            ws.extend([
                ui.Divider("divider[0]"),
                ui.Entry("kdump.nfs_location",
                         _("NFS Location ") + _("(example.com:/var/crash):"),
                         align_vertical=True),
                ui.Divider("divider[1]"),
                ui.Entry("kdump.ssh_location",
                         _("SSH Location ") + _("([email protected]):"),
                         align_vertical=True),
                ui.Entry("kdump.ssh_key",
                         "SSH Key URL (optional):",
                         align_vertical=True)
            ])
        page = ui.Page("page", ws)
        self.widgets.add(page)
        return page
Ejemplo n.º 8
0
    def ui_content(self):
        cfg = rhn_model.RHN().retrieve()
        if self.application.args.dry:
            net_is_configured = True
        else:
            net_is_configured = NodeNetwork().is_configured()

        if not net_is_configured:

            ws = ([
                ui.Divider("notice.divider"),
                ui.Notice(
                    "network.notice", "Networking is not configured, please " +
                    "configure it before configuring RHSM"),
                ui.Divider("notice.divider")
            ])

        else:
            rhn_msg = ("RHSM Registration is required only if you wish " +
                       "to use Red Hat Enterprise Linux with virtual " +
                       "guests subscriptions for your guests.")

            if cfg["rhntype"] and self._get_status(cfg) is not None:
                rhn_msg = self._get_status(cfg)

            ws = [
                ui.Header("header[0]", rhn_msg),
                ui.Entry("rhn.username", "Login:"******"rhn.password", "Password:"******"rhn.profilename", "Profile Name (optional):"),
                ui.Divider("divider[0]"),
                ui.Options("rhn.type", "Type", self._rhn_types),
                ui.Entry("rhn.url", "URL:"),
                ui.Entry("rhn.ca", "CA URL:"),
                ui.Entry("rhn.org", "Organization:"),
                ui.Entry("rhn.environment", "Environment:"),
                ui.Entry("rhn.activation_key", "Activation Key:"),
                ui.Button("button.proxy", "HTTP Proxy Configuration"),
            ]

        page = ui.Page("page", ws)
        self.widgets.add(ws)
        return page
    def ui_content(self):
        # Update the status on a page refresh
        self._model["hosted_engine.status"] = self.__get_vm_status()

        network_up = NodeNetwork().is_configured()

        ws = [ui.Header("header[0]", "Hosted Engine Setup")]

        if network_up:
            ws.extend([ui.KeywordLabel("hosted_engine.enabled",
                                       ("Hosted Engine: "))])
        else:
            ws.extend([ui.Notice("network.notice", "Networking is not " +
                                 "configured please configure it before " +
                                 "setting up hosted engine")])

        if self._configured():
            ws.extend([ui.Divider("divider[0]"),
                       ui.KeywordLabel("hosted_engine.vm",
                                       ("Engine VM: ")),
                       ui.KeywordLabel("hosted_engine.status",
                                       ("Engine Status: ")),
                       ui.Button("button.status", "Hosted Engine VM status"),
                       ui.Button("button.maintenance",
                                 "Set Hosted Engine maintenance")])

        if network_up:
            ws.extend([ui.Divider("divider.button"),
                       ui.Button("button.dialog", "Deploy Hosted Engine")])

        if self._show_progressbar:
            if "progress" in self._model:
                ws.append(ui.ProgressBar("download.progress",
                                         int(self._model["progress"])))
            else:
                ws.append(ui.ProgressBar("download.progress", 0))

            ws.append(ui.KeywordLabel("download.status", ""))

        page = ui.Page("page", ws)
        page.buttons = []
        self.widgets.add(page)
        return page
Ejemplo n.º 10
0
    def ui_content(self):

        ws = [
            ui.Header("header[0]", "Logging"),
            ui.Entry("logrotate.max_size",
                     "Logrotate Max Log " + "Size (KB):"),
            ui.Divider("divider[0]")
        ]
        if not utils.network.is_configured():
            ws.extend([
                ui.Notice(
                    "network.notice", "Networking is not configured, " +
                    "please configure it before rsyslog and/or netconsole"),
                ui.Divider("notice.divider")
            ])
        ws.extend([
            ui.Label("rsyslog.header",
                     "RSyslog is an enhanced multi-" + "threaded syslogd"),
            ui.Entry("rsyslog.address",
                     "Server Address:",
                     enabled=utils.network.is_configured()),
            ui.Entry("rsyslog.port",
                     "Server Port:",
                     enabled=utils.network.is_configured()),
            ui.Divider("divider[1]"),
            ui.Label(
                "netconsole.label", "Netconsole service allows a remote sys" +
                "log daemon to record printk() messages"),
            ui.Entry("netconsole.address",
                     "Server Address:",
                     enabled=utils.network.is_configured()),
            ui.Entry("netconsole.port",
                     "Server Port:",
                     enabled=utils.network.is_configured())
        ])

        page = ui.Page("page", ws)
        self.widgets.add(page)
        return page
Ejemplo n.º 11
0
    def ui_content(self):
        align = lambda l: l.ljust(16)
        if not self._model:
            self._build_model()

        ws = [
            ui.Header("header[0]", _("Confirm disk selections")),
            ui.Notice("notice[0]",
                      _("The data on these disks will "
                        "be erased!")),
            ui.KeywordLabel("boot.header", _("Boot device")),
            DiskDetails("boot.device.current", self,
                        self._model["boot.device.current"])
        ]

        if self._storage_tagged(self._model["boot.device.current"]):
            ws.extend([
                ui.Notice("boot.notice",
                          _("Boot device may be part "
                            "of a storage domain!"))
            ])

        ws.extend([ui.KeywordLabel("install.header", "Install devices")])

        for i in range(len(self._model["installation.devices"])):
            ws.extend([
                DiskDetails("installation.device[%s]" % i, self,
                            self._model["installation.devices"][i])
            ])
            if self._storage_tagged(self._model["installation.devices"][i]):
                ws.extend([
                    ui.Notice(
                        "installation.notice[%s]" % i,
                        _("This device may be part of a storage "
                          "domain!"))
                ])

        ws.extend([
            ui.Divider("divider[0]"),
            ui.KeywordLabel("storage.volumes", _("Volume sizes"))
        ])

        intuples = lambda lst, n: [lst[x:x + n] for x in range(0, len(lst), n)]
        for xs in intuples(
                sorted(k for k in self._model.keys()
                       if k.startswith("storage.")), 2):
            chi = []
            for x in xs:
                chi.append(
                    ui.KeywordLabel(
                        x,
                        _(
                            align(
                                x.replace("_", " ").replace(
                                    "storage.", "").title() + ":"))))
            row = ui.Row("row[%s]" % xs, chi)
            ws.append(row)

        if int(self._model["storage.data_size"]) < (50 * 1024):
            ws.extend([
                ui.Divider("divider.he"),
                ui.Notice(
                    "notice.he", "The size of the data volume is "
                    "not large enough to use the Engine "
                    "Appliance, must be at least 50GB (51200MB)")
            ])

        page = ui.Page("confirmation", ws)
        page.buttons = [
            ui.QuitButton("button.quit", _("Quit")),
            ui.Button("button.back", _("Back")),
            ui.SaveButton("button.next", _("Confirm"))
        ]

        self.widgets.add(page)
        return page