diff options
author | ricolin <rico.lin@easystack.cn> | 2018-02-07 15:44:18 +0800 |
---|---|---|
committer | Sean McGinnis <sean.mcginnis@gmail.com> | 2019-09-20 19:36:27 +0000 |
commit | dd6560f9618662198e25b298804742177db70e13 (patch) | |
tree | c97fcd18344b4d28ef6e29eee885d51670294051 | |
parent | eca16376563c2b0249d5b2aba1f6283a5aebbe98 (diff) | |
download | python-heatclient-dd6560f9618662198e25b298804742177db70e13.tar.gz |
Ignore not found when delete in test
Ignore not found when delete stack or stack snapshot in tests.
Story: #1737100
Task: #19354
Change-Id: I6c980b68023b33dc318c5d9506c2cac5866c4924
(cherry picked from commit 3b74f2ddd1cb624b98264426509200da00ea3745)
-rw-r--r-- | heatclient/tests/functional/osc/v1/base.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/heatclient/tests/functional/osc/v1/base.py b/heatclient/tests/functional/osc/v1/base.py index c9a946e..591225a 100644 --- a/heatclient/tests/functional/osc/v1/base.py +++ b/heatclient/tests/functional/osc/v1/base.py @@ -15,6 +15,7 @@ import os import six from tempest.lib.cli import base from tempest.lib.cli import output_parser +from tempest.lib import exceptions as tempest_exc class OpenStackClientTestBase(base.ClientTestBase): @@ -81,7 +82,13 @@ class OpenStackClientTestBase(base.ClientTestBase): if wait: cmd += ' --wait' if id in self.openstack('stack list --short'): - self.openstack(cmd) + try: + self.openstack(cmd) + except tempest_exc.CommandFailed as e: + msg = "Stack not found: %s" % id + if msg in six.text_type(e.stdout): + return + raise def _stack_suspend(self, id, wait=True): cmd = 'stack suspend ' + id |