diff options
author | Emma Foley <emma.l.foley@intel.com> | 2018-02-19 23:15:11 +0000 |
---|---|---|
committer | Emma Foley <emma.l.foley@intel.com> | 2018-03-01 15:06:41 +0000 |
commit | 3c2924769969733632d22e128b48fccee0043069 (patch) | |
tree | 419712ba7fc796896c07c167f292ebb0baaf3b04 /yardstick/benchmark/contexts | |
parent | 5c2824d8e184a3ff63a52e7c7cca7b4e6f0c0222 (diff) |
Add methods to get an existing stack
* Add yardstick/orchestrator/heat.py:HeatStack.get
* Add yardstick/benchmark/contexts/heay.py:HeatContext.retrieve_existing_stack
JIRA: YARDSTICK-886
Change-Id: I6974b79a25f98066a49b1bc8ccd11383e7962091
Signed-off-by: Emma Foley <emma.l.foley@intel.com>
Diffstat (limited to 'yardstick/benchmark/contexts')
-rw-r--r-- | yardstick/benchmark/contexts/heat.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/yardstick/benchmark/contexts/heat.py b/yardstick/benchmark/contexts/heat.py index be8815060..ed301a998 100644 --- a/yardstick/benchmark/contexts/heat.py +++ b/yardstick/benchmark/contexts/heat.py @@ -26,6 +26,7 @@ from yardstick.benchmark.contexts.model import Server from yardstick.benchmark.contexts.model import update_scheduler_hints from yardstick.common import exceptions as y_exc from yardstick.common.openstack_utils import get_neutron_client +from yardstick.orchestrator.heat import HeatStack from yardstick.orchestrator.heat import HeatTemplate from yardstick.common import constants as consts from yardstick.common.utils import source_env @@ -312,6 +313,14 @@ class HeatContext(Context): # let the other failures happen, we want stack trace raise + def _retrieve_existing_stack(self, stack_name): + stack = HeatStack(stack_name) + if stack.get(): + return stack + else: + LOG.warning("Stack %s does not exist", self.name) + return None + def deploy(self): """deploys template into a stack using cloud""" LOG.info("Deploying context '%s' START", self.name) |