diff options
author | jose.lausuch <jose.lausuch@ericsson.com> | 2017-05-31 17:17:44 +0200 |
---|---|---|
committer | jose.lausuch <jose.lausuch@ericsson.com> | 2017-06-06 15:13:11 +0200 |
commit | 81e3719bce31a74b027e5ba97b5b89d76e133e5e (patch) | |
tree | 857ac218d6d8ee487ec8adf64eb1a783fb0090ff /functest/ci/prepare_env.py | |
parent | cce3644b0b0186676de974d32e02219e2ae5dc50 (diff) |
Remove call to fetch_os_creds.sh
After [1], the openstack credentials
are provided to Functest as a volume
directly from CI. The same has to be
done manually.
Functest doesn't need the script
fetch_os_creds.sh any longer.
[1] https://gerrit.opnfv.org/gerrit/#/c/35199/
Change-Id: I0883ad7b248526cfe9df3fde984345bd41869e82
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
Diffstat (limited to 'functest/ci/prepare_env.py')
-rwxr-xr-x | functest/ci/prepare_env.py | 44 |
1 files changed, 10 insertions, 34 deletions
diff --git a/functest/ci/prepare_env.py b/functest/ci/prepare_env.py index 8e17a4fc..19e37862 100755 --- a/functest/ci/prepare_env.py +++ b/functest/ci/prepare_env.py @@ -83,11 +83,9 @@ def check_env_variables(): % CONST.__getattribute__('INSTALLER_TYPE')) if CONST.__getattribute__('INSTALLER_IP') is None: - logger.warning("The env variable 'INSTALLER_IP' is not defined. " - "It is needed to fetch the OpenStack credentials. " - "If the credentials are not provided to the " - "container as a volume, please add this env variable " - "to the 'docker run' command.") + logger.warning( + "The env variable 'INSTALLER_IP' is not defined. It is recommended" + " to extract some information from the deployment") else: logger.info(" INSTALLER_IP=%s" % CONST.__getattribute__('INSTALLER_IP')) @@ -177,7 +175,6 @@ def create_directories(): def source_rc_file(): print_separator() - logger.info("Fetching RC file...") if CONST.__getattribute__('openstack_creds') is None: logger.warning("The environment variable 'creds' must be set and" @@ -187,38 +184,17 @@ def source_rc_file(): CONST.__getattribute__('dir_functest_conf'), 'openstack.creds') if not os.path.isfile(CONST.__getattribute__('openstack_creds')): - logger.info("RC file not provided. " - "Fetching it from the installer...") - if CONST.__getattribute__('INSTALLER_IP')is None: - logger.error("The env variable 'INSTALLER_IP' must be provided in" - " order to fetch the credentials from the installer.") - raise Exception("Missing CI_INSTALLER_IP.") - if (CONST.__getattribute__('INSTALLER_TYPE') not in - opnfv_constants.INSTALLERS): - logger.error("Cannot fetch credentials. INSTALLER_TYPE=%s is " - "not a valid OPNFV installer. Available " - "installers are : %s." % - (CONST.__getattribute__('INSTALLER_TYPE'), - opnfv_constants.INSTALLERS)) - raise Exception("Wrong INSTALLER_TYPE.") - - cmd = ("/home/opnfv/repos/releng/utils/fetch_os_creds.sh " - "-d %s -i %s -a %s" - % (CONST.__getattribute__('openstack_creds'), - CONST.__getattribute__('INSTALLER_TYPE'), - CONST.__getattribute__('INSTALLER_IP'))) - logger.debug("Executing command: %s" % cmd) - p = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE) - output = p.communicate()[0] - logger.debug("\n%s" % output) - if p.returncode != 0: - raise Exception("Failed to fetch credentials from installer.") + raise Exception( + "OpenStack credentials file not provided. " + "The OpenStack credentials must be in {}" + .format(CONST.__getattribute__('openstack_creds'))) else: logger.info("RC file provided in %s." % CONST.__getattribute__('openstack_creds')) if os.path.getsize(CONST.__getattribute__('openstack_creds')) == 0: - raise Exception("The file %s is empty." % - CONST.__getattribute__('openstack_creds')) + raise Exception( + "The OpenStack RC file {} is empty." + .format(CONST.__getattribute__('openstack_creds'))) logger.info("Sourcing the OpenStack RC file...") os_utils.source_credentials(CONST.__getattribute__('openstack_creds')) |