From 6687a26209571a33f05f1c17ca80fde7993c4b38 Mon Sep 17 00:00:00 2001 From: Luis Pigueiras Date: Fri, 20 Jul 2018 12:01:00 +0200 Subject: [PATCH] Fix keypairs clean up in magnum tests Change-Id: Ia74938865d6d86472194d7c5b50188f9163c6fdf --- CHANGELOG.rst | 10 ++++++++++ rally_openstack/contexts/magnum/clusters.py | 1 + rally_openstack/scenarios/magnum/clusters.py | 10 ++-------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ab8e0e9d..b13d829d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -16,6 +16,16 @@ Changelog .. Release notes for existing releases are MUTABLE! If there is something that was missed or can be improved, feel free to change it! +[unreleased] - 2018-07-20 +------------------------- + +Fixed +~~~~~ + +* Keypairs are now properly cleaned up after the execution of Magnum + tests. + + [1.2.0] - 2018-06-25 -------------------- diff --git a/rally_openstack/contexts/magnum/clusters.py b/rally_openstack/contexts/magnum/clusters.py index a45ed55d..11f4febd 100644 --- a/rally_openstack/contexts/magnum/clusters.py +++ b/rally_openstack/contexts/magnum/clusters.py @@ -51,6 +51,7 @@ class ClusterGenerator(context.Context): nova_scenario = nova_utils.NovaScenario({ "user": user, "task": self.context["task"], + "owner_id": self.context["owner_id"], "config": {"api_versions": self.context["config"].get( "api_versions", [])} }) diff --git a/rally_openstack/scenarios/magnum/clusters.py b/rally_openstack/scenarios/magnum/clusters.py index 1491ba33..90def1df 100644 --- a/rally_openstack/scenarios/magnum/clusters.py +++ b/rally_openstack/scenarios/magnum/clusters.py @@ -53,7 +53,7 @@ class ListClusters(utils.MagnumScenario): context={"cleanup@openstack": ["magnum.clusters", "nova.keypairs"]}, name="MagnumClusters.create_and_list_clusters", platform="openstack") -class CreateAndListClusters(utils.MagnumScenario): +class CreateAndListClusters(utils.MagnumScenario, nova_utils.NovaScenario): def run(self, node_count, **kwargs): """create cluster and then list all clusters. @@ -69,13 +69,7 @@ class CreateAndListClusters(utils.MagnumScenario): else: del kwargs["cluster_template_uuid"] - nova_scenario = nova_utils.NovaScenario({ - "user": self.context["user"], - "task": self.context["task"], - "config": {"api_versions": self.context["config"].get( - "api_versions", [])} - }) - keypair = nova_scenario._create_keypair() + keypair = self._create_keypair() new_cluster = self._create_cluster(cluster_template_uuid, node_count, keypair=keypair, **kwargs)