summaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/contexts
diff options
context:
space:
mode:
Diffstat (limited to 'yardstick/benchmark/contexts')
-rw-r--r--yardstick/benchmark/contexts/base.py4
-rw-r--r--yardstick/benchmark/contexts/dummy.py2
-rw-r--r--yardstick/benchmark/contexts/heat.py2
-rw-r--r--yardstick/benchmark/contexts/node.py2
-rw-r--r--yardstick/benchmark/contexts/standalone.py2
5 files changed, 10 insertions, 2 deletions
diff --git a/yardstick/benchmark/contexts/base.py b/yardstick/benchmark/contexts/base.py
index 9f2b21537..0be2eee77 100644
--- a/yardstick/benchmark/contexts/base.py
+++ b/yardstick/benchmark/contexts/base.py
@@ -46,6 +46,10 @@ class Context(object):
@abc.abstractmethod
def undeploy(self):
"""Undeploy context."""
+ self._delete_context()
+
+ def _delete_context(self):
+ Context.list.remove(self)
@abc.abstractmethod
def _get_server(self, attr_name):
diff --git a/yardstick/benchmark/contexts/dummy.py b/yardstick/benchmark/contexts/dummy.py
index 0edc250f8..c658d3257 100644
--- a/yardstick/benchmark/contexts/dummy.py
+++ b/yardstick/benchmark/contexts/dummy.py
@@ -33,7 +33,7 @@ class DummyContext(Context):
def undeploy(self):
"""don't need to undeploy"""
- pass
+ super(DummyContext, self).undeploy()
def _get_server(self, attr_name):
return None
diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py
index 479548b34..64d913a47 100644
--- a/yardstick/benchmark/contexts/heat.py
+++ b/yardstick/benchmark/contexts/heat.py
@@ -257,6 +257,8 @@ class HeatContext(Context):
except OSError:
LOG.exception("Key filename %s", self.key_filename)
+ super(HeatContext, self).undeploy()
+
def _get_server(self, attr_name):
"""lookup server info by name from context
attr_name: either a name for a server created by yardstick or a dict
diff --git a/yardstick/benchmark/contexts/node.py b/yardstick/benchmark/contexts/node.py
index 6fa9aa99a..f8c38cb1c 100644
--- a/yardstick/benchmark/contexts/node.py
+++ b/yardstick/benchmark/contexts/node.py
@@ -89,6 +89,8 @@ class NodeContext(Context):
for host, info in teardown.items():
self._execute_script(host, info)
+ super(NodeContext, self).undeploy()
+
def _get_server(self, attr_name):
"""lookup server info by name from context
attr_name: a name for a server listed in nodes config file
diff --git a/yardstick/benchmark/contexts/standalone.py b/yardstick/benchmark/contexts/standalone.py
index eff700974..674e57f54 100644
--- a/yardstick/benchmark/contexts/standalone.py
+++ b/yardstick/benchmark/contexts/standalone.py
@@ -79,7 +79,7 @@ class StandaloneContext(Context):
"""don't need to undeploy"""
# Todo: NFVi undeploy (sriov, vswitch, ovs etc) based on the config.
- pass
+ super(StandaloneContext, self).undeploy()
def _get_server(self, attr_name):
"""lookup server info by name from context