Eis-D-Z commented on a change in pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#discussion_r476505700



##########
File path: libcloud/container/drivers/lxd.py
##########
@@ -1225,12 +1444,102 @@ def ex_delete_storage_pool_volume(self, pool_id, type, 
name):
         :return:
         """
 
-        response = self.connection.request("/%s/storage-pools/%s/volumes/%s/%s"
-                                           % (self.version, pool_id,
-                                              type, name),
-                                           method="DELETE")
+        try:
+
+            req = "/%s/storage-pools/%s/volumes/%s/%s" % (self.version,
+                                                          pool_id,
+                                                          type,
+                                                          name)
+            response = self.connection.request(req, method="DELETE")
+
+            response_dict = response.parse_body()
+            assert_response(response_dict=response_dict, status_code=200)
+        except BaseHTTPError as err:

Review comment:
       It is tricky, there are two kinds of operations, sync and async for lxd. 
The error handling with the timeout which is duplicated a few times is for the 
async methods. The response class won't have that info though so the code would 
not get simpler. If you have in mind some way please share.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to