コード例 #1
0
ファイル: views.py プロジェクト: shintana/NCU-HASS-i3.1
 def get_data(self):
     hypervisors = []
     try:
         hypervisors = nova.hypervisor_list(self.request)
         hypervisors.sort(key=utils.natural_sort('hypervisor_hostname'))
     except Exception:
         exceptions.handle(self.request,
                           _('Unable to retrieve hypervisor information.'))
     return hypervisors
コード例 #2
0
ファイル: tabs.py プロジェクト: bawn92/horizon
    def get_hypervisors_data(self):
        hypervisors = []
        try:
            hypervisors = nova.hypervisor_list(self.request)
            hypervisors.sort(key=utils.natural_sort("hypervisor_hostname"))
        except Exception:
            exceptions.handle(self.request, _("Unable to retrieve hypervisor information."))

        return hypervisors
コード例 #3
0
ファイル: tabs.py プロジェクト: yianjiajia/openstack_horizon
    def get_hypervisors_data(self):
        hypervisors = []
        try:
            hypervisors = nova.hypervisor_list(self.request)
        except Exception:
            exceptions.handle(self.request,
                              _('Unable to retrieve hypervisor information.'))

        return hypervisors
コード例 #4
0
ファイル: tabs.py プロジェクト: 1oscar/horizon
    def get_hypervisors_data(self):
        hypervisors = []
        try:
            hypervisors = nova.hypervisor_list(self.request)
        except Exception:
            exceptions.handle(self.request,
                              _('Unable to retrieve hypervisor information.'))

        return hypervisors
コード例 #5
0
 def get(self, request):
     """get host list"""
     hypervisors = nova.hypervisor_list(request)
     items = []
     for h in hypervisors:
         hypervisor = h.to_dict()
         # TODO(ecelik): Hosts do not have a uuid so I used
         # python uuid method to generate one,
         # this can be removed if we get hosts' uuid
         hypervisor['color'] = intToRGB(hashCode(str(uuid.uuid4())))
         items.append(hypervisor)
     return {'items': items}
コード例 #6
0
ファイル: views.py プロジェクト: hacker8485/HASS
 def get_data(self):
     ipmi_hypervisors = []
     try:
         hypervisors = nova.hypervisor_list(self.request)
         for hypervisor in hypervisors:
             if self.ipmi_state(hypervisor.hypervisor_hostname):
                 ipmi_hypervisors.append(hypervisor)
         ipmi_hypervisors.sort(
             key=utils.natural_sort('hypervisor_hostname'))
     except Exception:
         exceptions.handle(self.request,
                           _('Unable to retrieve hypervisor information.'))
     return ipmi_hypervisors
コード例 #7
0
ファイル: monitor.py プロジェクト: zouyapeng/horizon-newtouch
def node_list(request):
    hypervisors = hypervisor_list(request)
    hypervisors.sort(key=utils.natural_sort('hypervisor_hostname'))

    print hypervisors[0]

    nodelist = []
    for hypervisor in hypervisors:
        node = Node(hypervisor.id, hypervisor.hypervisor_hostname,
                    hypervisor.host_ip)
        node.get_status()
        nodelist.append(node)

    return nodelist
コード例 #8
0
    def get_hypervisors_data(self):
        hypervisors = []
        try:
            hypervisors = nova.hypervisor_list(self.request)
            LOG.error("hypervisors : %s" % hypervisors)
            for hv in hypervisors:
                metadata = nova.hvspecs_metadata(self.request, hv)
                LOG.error("Fetched metadata")
                if hasattr(metadata, 'trust_report'):
                    LOG.error("trust_report : %s" % metadata.trust_report)
                    hv.geo_tag = metadata.trust_report
                else:
                    hv.geo_tag = None

        except Exception as ex:
            LOG.error(ex)
            exceptions.handle(self.request,
                              _('Unable to retrieve hypervisor information.'))

        return hypervisors
コード例 #9
0
ファイル: api.py プロジェクト: takanattie/masakari-dashboard
def get_hypervisor_list(request):
    return nova_api.hypervisor_list(request)