Esempio n. 1
0
    def model(self):
        mng = defaults.Management()
        managementifs = mng.retrieve()["managed_ifnames"]

        # If prmiaryif == None, then the corretc NIC will be automatically be
        # determined
        primaryif = managementifs[0] if managementifs else None

        self.logger.debug("NIC for status: %s" % primaryif)

        net_status, net_br, net_addrs = \
            utils.network.networking_status(primaryif)
        net_addrs_str = ""
        if net_addrs:
            net_addrs_str = "IPv4: {inet}\nIPv6: {inet6}".format(**net_addrs)

        num_domains = virt.number_of_domains()

        model = {
            "status": virt.hardware_status(),
            "managed_by": mng.retrieve()["managed_by"],
            "networking": net_status,
            "networking.ip": net_addrs_str,
            "networking.bridge": net_br,
            "logs": self._logging_summary(),
            "libvirt.num_guests": num_domains,
        }

        model.update(self._extra_model)
        return model
Esempio n. 2
0
    def model(self):
        mng = defaults.Management()
        managementifs = mng.retrieve()["managed_ifnames"]

        # If prmiaryif == None, then the corretc NIC will be automatically be
        # determined
        primaryif = managementifs[0] if managementifs else None

        self.logger.debug("NIC for status: %s" % primaryif)

        net_status, net_br, net_addrs = \
            utils.network.networking_status(primaryif)
        net_addrs_str = ""
        if net_addrs:
            net_addrs_str = "IPv4: {inet}\nIPv6: {inet6}".format(**net_addrs)

        num_domains = virt.number_of_domains()

        model = {
            "status": virt.hardware_status(),
            "managed_by": mng.retrieve()["managed_by"],
            "networking": net_status,
            "networking.ip": net_addrs_str,
            "networking.bridge": net_br,
            "logs": self._logging_summary(),
            "libvirt.num_guests": num_domains,
        }

        model.update(self._extra_model)
        return model
Esempio n. 3
0
 def __additional_infos(self):
     ws = []
     ws.append(ui.Label("welcome.virt", _("Info: %s") %
                        virt.hardware_status()))
     if system.is_efi():
         ws.append(ui.Label("welcome.efi",
                            _("Info: Machine is booted in EFI mode")))
     if self.application.args.dry:
         ws.append(ui.Label("dry", _("Info: DRY MODE")))
     return ws
Esempio n. 4
0
    def model(self):
        net_status, net_br, net_addrs = utils.network.networking_status()
        net_addrs_str = ""
        if net_addrs:
            net_addrs_str = "\nIPv4: {inet}\nIPv6: {inet6}".format(**net_addrs)

        num_domains = virt.number_of_domains()

        return {
            "status": virt.hardware_status(),
            "networking": net_status,
            "networking.bridge": "%s %s" % (net_br, net_addrs_str),
            "logs": self._logging_summary(),
            "libvirt.num_guests": num_domains,
        }
Esempio n. 5
0
    def model(self):
        net_status, net_br, net_addrs = utils.network.networking_status()
        net_addrs_str = ""
        if net_addrs:
            net_addrs_str = "\nIPv4: {inet}\nIPv6: {inet6}".format(**net_addrs)

        num_domains = virt.number_of_domains()

        return {
            "status": virt.hardware_status(),
            "networking": net_status,
            "networking.bridge": "%s %s" % (net_br, net_addrs_str),
            "logs": self._logging_summary(),
            "libvirt.num_guests": num_domains,
        }