aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/benchmark/contexts/heat.py
diff options
context:
space:
mode:
authorEmma Foley <emma.l.foley@intel.com>2018-02-26 11:43:51 +0000
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-03-01 11:22:58 +0000
commitc9b24900ab4782c946f5a423e9c16365abced786 (patch)
tree11b4fb75819034ab587579e0cf577a856f71c764 /yardstick/benchmark/contexts/heat.py
parent793569e2ce7ebf5b4d549db94423b851f13950fc (diff)
Add qualified name to Context
The context name depends on the defined name in the testcase input file, the task ID and the flags of the context. If the context is going to be undeployed at the end of the test, the task ID is suffixed to the name to avoid interferences with previous deployments. If the context needs to be deployed at the end of the test, the name assigned is kept. This patch makes base.Context use Flags when initialising contexts, this sets the name property based on the no_setup and no_teardown flags. Since base.Context is an abstract class, it cannot be instantiated. However, there are some non-abstract methods that need testing. Since DummyContext does not override any of these methods, it can be used for testing. JIRA: YARDSTICK-886 Change-Id: I1447fb5ed447691eaeb0a97f928c0b3333799d07 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com> Signed-off-by: Emma Foley <emma.l.foley@intel.com>
Diffstat (limited to 'yardstick/benchmark/contexts/heat.py')
-rw-r--r--yardstick/benchmark/contexts/heat.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py
index 7b7f1be32..1e2537738 100644
--- a/yardstick/benchmark/contexts/heat.py
+++ b/yardstick/benchmark/contexts/heat.py
@@ -50,7 +50,6 @@ class HeatContext(Context):
__context_type__ = "Heat"
def __init__(self):
- self.name = None
self.stack = None
self.networks = OrderedDict()
self.heat_timeout = None
@@ -95,10 +94,10 @@ class HeatContext(Context):
return sorted_networks
def init(self, attrs):
- """initializes itself from the supplied arguments"""
- self.check_environment()
- self.name = attrs["name"]
+ """Initializes itself from the supplied arguments"""
+ super(HeatContext, self).init(attrs)
+ self.check_environment()
self._user = attrs.get("user")
self.template_file = attrs.get("heat_template")
@@ -313,7 +312,7 @@ class HeatContext(Context):
timeout=self.heat_timeout)
except KeyboardInterrupt:
raise SystemExit("\nStack create interrupted")
- except:
+ except Exception:
LOG.exception("stack failed")
# let the other failures happen, we want stack trace
raise