diff --git a/rally_openstack/credential.py b/rally_openstack/credential.py index 63574177..f3bbba8b 100644 --- a/rally_openstack/credential.py +++ b/rally_openstack/credential.py @@ -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), diff --git a/rally_openstack/platforms/existing.py b/rally_openstack/platforms/existing.py index 37f9807c..1a95bed4 100644 --- a/rally_openstack/platforms/existing.py +++ b/rally_openstack/platforms/existing.py @@ -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") diff --git a/tests/functional/test_cli_env.py b/tests/functional/test_cli_env.py index 3ad42b5c..fc22ebb7 100644 --- a/tests/functional/test_cli_env.py +++ b/tests/functional/test_cli_env.py @@ -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")