summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-06-13 21:51:22 +0000
committerGerrit Code Review <review@openstack.org>2018-06-13 21:51:22 +0000
commit9670f4b8d813e37c80d1b6076affbf500f027ca3 (patch)
tree681437c044c11aacb1f3b86a45644b5ea4f9aeb7
parent680d62b7ea8e8db0e99cfecc4dab65a94155010c (diff)
parent35ac83ae06f03b07b2479c7b09c9f18e4a07a067 (diff)
downloadpython-saharaclient-9670f4b8d813e37c80d1b6076affbf500f027ca3.tar.gz
Merge "Support of the improved force-delete in client"
-rw-r--r--saharaclient/api/base.py5
-rw-r--r--saharaclient/api/clusters.py2
2 files changed, 5 insertions, 2 deletions
diff --git a/saharaclient/api/base.py b/saharaclient/api/base.py
index 9dccf13..d743b60 100644
--- a/saharaclient/api/base.py
+++ b/saharaclient/api/base.py
@@ -213,9 +213,12 @@ class ResourceManager(object):
else:
resp = self.api.delete(url)
- if resp.status_code != 204:
+ if resp.status_code not in [200, 204]:
self._raise_api_exception(resp)
+ if resp.status_code == 200:
+ return get_json(resp)
+
def _plurify_resource_name(self):
return self.resource_class.resource_name + 's'
diff --git a/saharaclient/api/clusters.py b/saharaclient/api/clusters.py
index fefad51..6030bfe 100644
--- a/saharaclient/api/clusters.py
+++ b/saharaclient/api/clusters.py
@@ -211,7 +211,7 @@ class ClusterManagerV2(ClusterManagerV1):
def force_delete(self, cluster_id):
"""Force Delete a Cluster."""
data = {'force': True}
- self._delete('/clusters/%s' % cluster_id, data)
+ return self._delete('/clusters/%s' % cluster_id, data)
# NOTE(jfreud): keep this around for backwards compatibility