diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-02-08 18:55:08 +0100 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-02-08 19:24:34 +0100 |
commit | 181e6d6e4828711744d451185d64c5c4939824fe (patch) | |
tree | 18722b0e324de7e11234c22dc44efd3d429dd262 /functest/api | |
parent | 89bb80232f777b0619d4168b292338c16a0a704c (diff) |
Move source_credentials() into run_tests.py
It's also renamed source_envfile().
Change-Id: I0e7c38c2def125961f86dc2bc9a63cfb6ad87c03
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/api')
-rw-r--r-- | functest/api/resources/v1/creds.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/functest/api/resources/v1/creds.py b/functest/api/resources/v1/creds.py index c4797fc2..fefbbaa9 100644 --- a/functest/api/resources/v1/creds.py +++ b/functest/api/resources/v1/creds.py @@ -13,16 +13,16 @@ Resources to handle openstack related requests import collections import logging -import pkg_resources import socket from flask import jsonify from flasgger.utils import swag_from +import pkg_resources from functest.api.base import ApiResource from functest.api.common import api_utils +from functest.ci import run_tests from functest.cli.commands.cli_os import OpenStack -from functest.utils import openstack_utils as os_utils from functest.utils.constants import CONST LOGGER = logging.getLogger(__name__) @@ -39,7 +39,7 @@ class V1Creds(ApiResource): endpoint='{0}/credentials'.format(ENDPOINT_CREDS)) def get(self): # pylint: disable=no-self-use """ Get credentials """ - os_utils.source_credentials(CONST.__getattribute__('env_file')) + run_tests.Runner.source_envfile(CONST.__getattribute__('env_file')) credentials_show = OpenStack.show_credentials() return jsonify(credentials_show) @@ -71,7 +71,7 @@ class V1Creds(ApiResource): LOGGER.info("Sourcing the OpenStack RC file...") try: - os_utils.source_credentials(rc_file) + run_tests.Runner.source_envfile(rc_file) except Exception as err: # pylint: disable=broad-except LOGGER.exception('Failed to source the OpenStack RC file') return api_utils.result_handler(status=0, data=str(err)) |