summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Freudberg <jeremyfreudberg@gmail.com>2018-06-12 14:48:48 -0400
committerJeremy Freudberg <jeremyfreudberg@gmail.com>2018-06-12 14:49:16 -0400
commit35ac83ae06f03b07b2479c7b09c9f18e4a07a067 (patch)
treeec5d3e9d973cc3e74bbf21db9f2e4c040ae84cf2
parentf117734a98de26581bf053186731faffddda68e6 (diff)
downloadpython-saharaclient-35ac83ae06f03b07b2479c7b09c9f18e4a07a067.tar.gz
Support of the improved force-delete in client
Change-Id: I24552338a3b8234abb718579c7eb73409be34f02
-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 1ac5d36..de6cf83 100644
--- a/saharaclient/api/clusters.py
+++ b/saharaclient/api/clusters.py
@@ -208,7 +208,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