X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=utils%2Fopenstack_snapshot.py;h=058f9ded319db7ed2d92aea9c408afccb104ecf7;hb=835e6b5e54693f9a8439325f8c70aeb878ffc800;hp=704ef5053b1def4636c0e5a1f6aad2fd895f98da;hpb=bbc47d487f06da2906116e5ade134e11c4221786;p=functest.git diff --git a/utils/openstack_snapshot.py b/utils/openstack_snapshot.py old mode 100644 new mode 100755 index 704ef5053..058f9ded3 --- a/utils/openstack_snapshot.py +++ b/utils/openstack_snapshot.py @@ -20,17 +20,10 @@ # http://www.apache.org/licenses/LICENSE-2.0 # -""" logging configuration """ - import os - -from cinderclient import client as cinderclient import functest.utils.functest_logger as ft_logger import functest.utils.functest_utils as ft_utils import functest.utils.openstack_utils as os_utils -from keystoneclient.v2_0 import client as keystoneclient -from neutronclient.v2_0 import client as neutronclient -from novaclient import client as novaclient import yaml @@ -143,21 +136,12 @@ def get_tenants(keystone_client): def main(): - creds_nova = os_utils.get_credentials("nova") - nova_client = novaclient.Client('2', **creds_nova) - - creds_neutron = os_utils.get_credentials("neutron") - neutron_client = neutronclient.Client(**creds_neutron) - - creds_keystone = os_utils.get_credentials("keystone") - keystone_client = keystoneclient.Client(**creds_keystone) + logger.info("Generating OpenStack snapshot...") - 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") + nova_client = os_utils.get_nova_client() + neutron_client = os_utils.get_neutron_client() + keystone_client = os_utils.get_keystone_client() + cinder_client = os_utils.get_cinder_client() if not os_utils.check_credentials(): logger.error("Please source the openrc credentials and run the" +