diff options
Diffstat (limited to 'utils/generate_defaults.py')
-rw-r--r-- | utils/generate_defaults.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/utils/generate_defaults.py b/utils/generate_defaults.py index 4c2065e4a..0a1e498f6 100644 --- a/utils/generate_defaults.py +++ b/utils/generate_defaults.py @@ -28,7 +28,7 @@ from neutronclient.v2_0 import client as neutronclient from keystoneclient.v2_0 import client as keystoneclient from cinderclient import client as cinderclient -import functest.utils.openstack_utils as openstack_utils +import functest.utils.openstack_utils as os_utils import functest.utils.functest_logger as ft_logger """ logging configuration """ @@ -50,7 +50,7 @@ def separator(): def get_instances(nova_client): logger.debug("Getting instances...") dic_instances = {} - instances = openstack_utils.get_instances(nova_client) + instances = os_utils.get_instances(nova_client) if not (instances is None or len(instances) == 0): for instance in instances: dic_instances.update({getattr(instance, 'id'): getattr(instance, @@ -61,7 +61,7 @@ def get_instances(nova_client): def get_images(nova_client): logger.debug("Getting images...") dic_images = {} - images = openstack_utils.get_images(nova_client) + images = os_utils.get_images(nova_client) if not (images is None or len(images) == 0): for image in images: dic_images.update({getattr(image, 'id'): getattr(image, 'name')}) @@ -71,7 +71,7 @@ def get_images(nova_client): def get_volumes(cinder_client): logger.debug("Getting volumes...") dic_volumes = {} - volumes = openstack_utils.get_volumes(cinder_client) + volumes = os_utils.get_volumes(cinder_client) if volumes is not None: for volume in volumes: dic_volumes.update({volume.id: volume.display_name}) @@ -81,7 +81,7 @@ def get_volumes(cinder_client): def get_networks(neutron_client): logger.debug("Getting networks") dic_networks = {} - networks = openstack_utils.get_network_list(neutron_client) + networks = os_utils.get_network_list(neutron_client) if networks is not None: for network in networks: dic_networks.update({network['id']: network['name']}) @@ -91,7 +91,7 @@ def get_networks(neutron_client): def get_routers(neutron_client): logger.debug("Getting routers") dic_routers = {} - routers = openstack_utils.get_router_list(neutron_client) + routers = os_utils.get_router_list(neutron_client) if routers is not None: for router in routers: dic_routers.update({router['id']: router['name']}) @@ -101,7 +101,7 @@ def get_routers(neutron_client): def get_security_groups(neutron_client): logger.debug("Getting Security groups...") dic_secgroups = {} - secgroups = openstack_utils.get_security_groups(neutron_client) + secgroups = os_utils.get_security_groups(neutron_client) if not (secgroups is None or len(secgroups) == 0): for secgroup in secgroups: dic_secgroups.update({secgroup['id']: secgroup['name']}) @@ -111,7 +111,7 @@ def get_security_groups(neutron_client): def get_floatinips(nova_client): logger.debug("Getting Floating IPs...") dic_floatingips = {} - floatingips = openstack_utils.get_floating_ips(nova_client) + floatingips = os_utils.get_floating_ips(nova_client) if not (floatingips is None or len(floatingips) == 0): for floatingip in floatingips: dic_floatingips.update({floatingip.id: floatingip.ip}) @@ -121,7 +121,7 @@ def get_floatinips(nova_client): def get_users(keystone_client): logger.debug("Getting users...") dic_users = {} - users = openstack_utils.get_users(keystone_client) + users = os_utils.get_users(keystone_client) if not (users is None or len(users) == 0): for user in users: dic_users.update({getattr(user, 'id'): getattr(user, 'name')}) @@ -131,7 +131,7 @@ def get_users(keystone_client): def get_tenants(keystone_client): logger.debug("Getting users...") dic_tenants = {} - tenants = openstack_utils.get_tenants(keystone_client) + tenants = os_utils.get_tenants(keystone_client) if not (tenants is None or len(tenants) == 0): for tenant in tenants: dic_tenants.update({getattr(tenant, 'id'): @@ -140,23 +140,23 @@ def get_tenants(keystone_client): def main(): - creds_nova = openstack_utils.get_credentials("nova") + creds_nova = os_utils.get_credentials("nova") nova_client = novaclient.Client('2', **creds_nova) - creds_neutron = openstack_utils.get_credentials("neutron") + creds_neutron = os_utils.get_credentials("neutron") neutron_client = neutronclient.Client(**creds_neutron) - creds_keystone = openstack_utils.get_credentials("keystone") + creds_keystone = os_utils.get_credentials("keystone") keystone_client = keystoneclient.Client(**creds_keystone) - creds_cinder = openstack_utils.get_credentials("cinder") + creds_cinder = os_utils.get_credentials("cinder") cinder_client = cinderclient.Client('1', creds_cinder['username'], creds_cinder['api_key'], creds_cinder['project_id'], creds_cinder['auth_url'], service_type="volume") - if not openstack_utils.check_credentials(): + if not os_utils.check_credentials(): logger.error("Please source the openrc credentials and run the" + "script again.") exit(-1) |