from flask import jsonify
from flasgger.utils import swag_from
import pkg_resources
+from xtesting.ci import run_tests
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.constants import CONST
+from functest.utils import constants
LOGGER = logging.getLogger(__name__)
endpoint='{0}/credentials'.format(ENDPOINT_CREDS))
def get(self): # pylint: disable=no-self-use
""" Get credentials """
- run_tests.Runner.source_envfile(getattr(CONST, 'env_file'))
+ run_tests.Runner.source_envfile(constants.ENV_FILE)
credentials_show = OpenStack.show_credentials()
return jsonify(credentials_show)
lines = ['export {}={}\n'.format(k, v) for k, v in openrc_vars.items()]
- rc_file = getattr(CONST, 'env_file')
+ rc_file = constants.ENV_FILE
with open(rc_file, 'w') as creds_file:
creds_file.writelines(lines)