Example #1
0
    def get_hypervisor_list(self, cred):
        ret_list = []
        sess = create_auth_session(cred)
        nova_client = novaclient('2', endpoint_type='publicURL',
                                 http_log_debug=True, session=sess)
        for hypervisor in nova_client.hypervisors.list():
            if vars(hypervisor)['status'] == 'enabled':
                ret_list.append(vars(hypervisor)['hypervisor_hostname'])

        return ret_list
Example #2
0
    def get_az_list(self, cred):
        ret_list = []
        sess = create_auth_session(cred)
        nova_client = novaclient('2', endpoint_type='publicURL',
                                 http_log_debug=True, session=sess)
        for az in nova_client.availability_zones.list():
            zoneName = vars(az)['zoneName']
            isAvail = vars(az)['zoneState']['available']
            if zoneName != 'internal' and isAvail:
                ret_list.append(zoneName)

        return ret_list
Example #3
0
    def get_hypervisor_list(self, cred):
        ret_list = []
        sess = cred.get_session()
        nova_client = novaclient('2',
                                 endpoint_type='publicURL',
                                 http_log_debug=True,
                                 session=sess)
        for hypervisor in nova_client.hypervisors.list():
            if vars(hypervisor)['status'] == 'enabled':
                ret_list.append(vars(hypervisor)['hypervisor_hostname'])

        return ret_list
Example #4
0
    def get_az_list(self, cred):
        ret_list = []
        sess = cred.get_session()
        nova_client = novaclient('2',
                                 endpoint_type='publicURL',
                                 http_log_debug=True,
                                 session=sess)
        for az in nova_client.availability_zones.list():
            zoneName = vars(az)['zoneName']
            isAvail = vars(az)['zoneState']['available']
            if zoneName != 'internal' and isAvail:
                ret_list.append(zoneName)

        return ret_list