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
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
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
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}
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
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
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
def get_hypervisor_list(request): return nova_api.hypervisor_list(request)