summaryrefslogtreecommitdiff
path: root/openstackclient/common/utils.py
diff options
context:
space:
mode:
authorMark Vanderwiel <vanderwl@us.ibm.com>2015-11-18 16:21:33 -0600
committerMark Vanderwiel <vanderwl@us.ibm.com>2015-11-18 17:48:43 -0600
commit71e1adeaf07ec1bf7f2e9bdd0c93ec2c90da85f7 (patch)
tree5528defc0032174ce2e3c2457c622ac43a87301c /openstackclient/common/utils.py
parent5f6f456bfd388c199d837371fe11bb041fa2cfd9 (diff)
downloadpython-openstackclient-71e1adeaf07ec1bf7f2e9bdd0c93ec2c90da85f7.tar.gz
Allow error status to be specified
For some apis, heat, the error status is "failed". This patch changes the wait_for_status method to allow for the error status to be passed in the same way as the success status. Change-Id: I20db4051d3f5611a4b13fe23ea8798b82a40da81
Diffstat (limited to 'openstackclient/common/utils.py')
-rw-r--r--openstackclient/common/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/openstackclient/common/utils.py b/openstackclient/common/utils.py
index 8db4f35b..0a1f8e0e 100644
--- a/openstackclient/common/utils.py
+++ b/openstackclient/common/utils.py
@@ -298,6 +298,7 @@ def wait_for_status(status_f,
res_id,
status_field='status',
success_status=['active'],
+ error_status=['error'],
sleep_time=5,
callback=None):
"""Wait for status change on a resource during a long-running operation
@@ -316,7 +317,7 @@ def wait_for_status(status_f,
if status in success_status:
retval = True
break
- elif status == 'error':
+ elif status in error_status:
retval = False
break
if callback: