3 # Copyright (c) 2017 Huawei Technologies Co.,Ltd and others.
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
11 Resources to handle openstack related requests
14 from flask import jsonify
16 from functest.api.base import ApiResource
17 from functest.cli.commands.cli_os import OpenStack
18 from functest.utils import openstack_utils as os_utils
19 from functest.utils.constants import CONST
22 class V1Creds(ApiResource):
23 """ V1Creds Resource class"""
25 def get(self): # pylint: disable=no-self-use
26 """ Get credentials """
27 os_utils.source_credentials(CONST.__getattribute__('openstack_creds'))
28 credentials_show = OpenStack.show_credentials()
29 return jsonify(credentials_show)