Merge "[rally env]Move (https_cert, https_key) to OpenStackCredential"

This commit is contained in:
Zuul 2019-04-08 15:24:43 +00:00 committed by Gerrit Code Review
commit 5f1a8f7137
3 changed files with 18 additions and 5 deletions

View File

@ -27,7 +27,8 @@ class OpenStackCredential(dict):
region_name=None, endpoint_type=None,
domain_name=None, endpoint=None, user_domain_name=None,
project_domain_name=None,
https_insecure=False, https_cacert=None, https_cert=None,
https_insecure=False, https_cacert=None,
https_cert=None, https_key=None,
profiler_hmac_key=None, profiler_conn_str=None,
api_info=None, **kwargs):
if kwargs:
@ -35,6 +36,9 @@ class OpenStackCredential(dict):
# TODO(andreykurilin): deprecate permission and endpoint
if https_cert and https_key:
https_cert = (https_cert, https_key)
super(OpenStackCredential, self).__init__([
("auth_url", auth_url),
("username", username),

View File

@ -135,10 +135,6 @@ class OpenStack(platform.Platform):
users = new_data.pop("users", [])
api_info = new_data.pop("api_info", None)
if new_data.get("https_cert") and new_data.get("https_key"):
new_data["https_cert"] = (new_data["https_cert"],
new_data.pop("https_key"))
if admin:
if "project_name" in admin:
admin["tenant_name"] = admin.pop("project_name")

View File

@ -192,3 +192,16 @@ class EnvTestCase(unittest.TestCase):
except utils.RallyCliError as e:
self.assertIn("Can not create 'faileddummy' with 2 version",
e.output)
def test_create_env_with_https_cert_https_key(self):
rally = utils.Rally()
fake_spec = copy.deepcopy(rally.env_spec)
fake_spec["existing@openstack"]["https_cert"] = ""
fake_spec["existing@openstack"]["https_key"] = ""
spec = utils.JsonTempFile(fake_spec)
rally("env create --name t_create_env --spec %s" % spec.filename)
config = rally("env show --only-spec", getjson=True)
self.assertIn("https_cert", config["existing@openstack"].keys())
self.assertIn("https_key", config["existing@openstack"].keys())
rally("env check")
rally("env info")