You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by GitBox <gi...@apache.org> on 2020/07/23 08:20:09 UTC
[GitHub] [libcloud] Eis-D-Z opened a new pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Eis-D-Z opened a new pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478
## Add Networks and storage pools
### Description
This enhances the lxd driver with network and storage pool capability while further refining existing methods, for example changing an image id to the unique fingerprint instead of the image name, etc...
### Status
- done, ready for review
### Checklist (tick everything that applies)
- [x] [Code linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide) (required, can be done after the PR checks)
- [ ] Documentation
- [x] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)
- [x] [ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes) (required for bigger changes)
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Eis-D-Z commented on a change in pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org
[GitHub] [libcloud] Kami commented on a change in pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Kami commented on a change in pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#discussion_r470845443
##########
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:
+ raise self._get_lxd_api_exception_for_error(err)
+
+ return True
+
+ def ex_list_networks(self):
+ """
+ Returns a list of networks.
+ Implements GET /1.0/networks
+ Authentication: trusted
+ Operation: sync
+
+ :rtype: list of LXDNetwork objects
+ """
+
+ req = "/%s/networks" % (self.version)
+ response = self.connection.request(req)
+
+ response_dict = response.parse_body()
+ assert_response(response_dict=response_dict, status_code=200)
+
+ nets = response_dict["metadata"]
+ networks = []
+ for net in nets:
+ name = net.split('/')[-1]
+ networks.append(self.ex_get_network(name=name))
Review comment:
This seems a bit wasteful - do we really need to perform another request for each network returned by /1.0/networks? Aka doesn't the list response contain enough information?
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Kami commented on a change in pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Kami commented on a change in pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#discussion_r470844475
##########
File path: libcloud/container/drivers/lxd.py
##########
@@ -1155,21 +1278,66 @@ def ex_get_storage_pool_volume(self, pool_id, type, name):
response_dict = response.parse_body()
assert_response(response_dict=response_dict, status_code=200)
- return self._to_storage_volume(response_dict["metadata"])
+ return self._to_storage_volume(pool_id=pool_id,
+ metadata=response_dict["metadata"])
- def ex_create_storage_pool_volume(self, pool_id, definition):
+ def ex_get_volume_by_name(self, name, vol_type="custom"):
"""
- Create a new storage volume on a given storage pool
+ Returns a storage volume that has the given name.
+ The function will loop over all storage-polls available
+ and will pick the first volume from the first storage poll
+ that matches the given name. Thus this function can be
+ quite expensive
- Operation: sync or async (when copying an existing volume)
+ :param name: The name of the volume to look for
+ :type name: str
+
+ :param vol_type: The type of the volume default is custom
+ :type vol_type: str
:return: A StorageVolume representing a storage volume
"""
+ req = '/%s/storage-pools' % self.version
+ response = self.connection.request(req)
+ response_dict = response.parse_body()
+ assert_response(response_dict=response_dict, status_code=200)
+
+ pools = response_dict['metadata']
+
+ for pool in pools:
+
+ pool_id = pool.split('/')[-1]
+
+ volumes = self.ex_list_storage_pool_volumes(pool_id=pool_id)
+
+ for vol in volumes:
+ if vol.name == name:
+ return vol
+
+ return self._to_storage_volume(pool_id=None,
Review comment:
Hm, shouldn't we simply return None if a matching volume doesn't exist?
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Kami commented on a change in pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Kami commented on a change in pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#discussion_r479781266
##########
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:
+ raise self._get_lxd_api_exception_for_error(err)
+
+ return True
+
+ def ex_list_networks(self):
+ """
+ Returns a list of networks.
+ Implements GET /1.0/networks
+ Authentication: trusted
+ Operation: sync
+
+ :rtype: list of LXDNetwork objects
+ """
+
+ req = "/%s/networks" % (self.version)
+ response = self.connection.request(req)
+
+ response_dict = response.parse_body()
+ assert_response(response_dict=response_dict, status_code=200)
+
+ nets = response_dict["metadata"]
+ networks = []
+ for net in nets:
+ name = net.split('/')[-1]
+ networks.append(self.ex_get_network(name=name))
Review comment:
I think classes are a good idea in general since they provide a better and more user-friendly API to the developers (in contrasts of dictionaries which are usually opaque and hard to work with since you need to inspect the docs / similar to see what attributes should be there...).
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Kami commented on a change in pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Kami commented on a change in pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#discussion_r464069826
##########
File path: libcloud/container/drivers/lxd.py
##########
@@ -971,6 +1073,25 @@ def list_images(self):
images.append(self.ex_get_image(fingerprint=fingerprint))
return images
+ def ex_has_image(self, alias):
+ """
+ Helper function. Returns true is the image with the
+ given alias exits on the host
+
+ :param alias: the image alias
+ :type alias: ``str``
+
+ :rtype: boolean
+ """
+
+ # get all the images existing on the host
+ images = self.list_images()
+
+ for img in images:
Review comment:
I assume there is no more efficient way of doing that (aka filter on the server side) and we need to do late filtering locally?
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Eis-D-Z commented on a change in pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Eis-D-Z commented on a change in pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#discussion_r475758595
##########
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:
+ raise self._get_lxd_api_exception_for_error(err)
+
+ return True
+
+ def ex_list_networks(self):
+ """
+ Returns a list of networks.
+ Implements GET /1.0/networks
+ Authentication: trusted
+ Operation: sync
+
+ :rtype: list of LXDNetwork objects
+ """
+
+ req = "/%s/networks" % (self.version)
+ response = self.connection.request(req)
+
+ response_dict = response.parse_body()
+ assert_response(response_dict=response_dict, status_code=200)
+
+ nets = response_dict["metadata"]
+ networks = []
+ for net in nets:
+ name = net.split('/')[-1]
+ networks.append(self.ex_get_network(name=name))
Review comment:
The /1.0/networks returns just a list of URLs ( [networks endpoint LXD API](https://github.com/lxc/lxd/blob/master/doc/rest-api.md#10networks) ), the previous contributor made a whole LXDNetwork class which needs a bit more data. As it is now an additional request for each network is required. If you think that there's no need to have a whole network class let me know.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Kami commented on a change in pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Kami commented on a change in pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#discussion_r464069754
##########
File path: libcloud/container/drivers/lxd.py
##########
@@ -662,10 +730,17 @@ def destroy_container(self, container, ex_timeout=default_time_out):
# Return: background operation or standard error
req = '/%s/containers/%s' % (self.version, container.name)
- response = self.connection.request(req, method='DELETE')
- response_dict = response.parse_body()
- assert_response(response_dict=response_dict, status_code=100)
+ try:
+ response = self.connection.request(req, method='DELETE')
+
+ response_dict = response.parse_body()
+ assert_response(response_dict=response_dict, status_code=100)
+ except BaseHTTPError as e:
+ # handle the case where the container is running
+ message_list = e.message.split(",")
Review comment:
EDIT: Or perhaps even, ``_get_lxd_ap_exception_for_error`` and returning ``LXDAPIException`` class instance.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] asfgit merged pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
asfgit merged pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Kami commented on a change in pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Kami commented on a change in pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#discussion_r464069802
##########
File path: libcloud/container/drivers/lxd.py
##########
@@ -971,6 +1073,25 @@ def list_images(self):
images.append(self.ex_get_image(fingerprint=fingerprint))
return images
+ def ex_has_image(self, alias):
+ """
+ Helper function. Returns true is the image with the
+ given alias exits on the host
+
+ :param alias: the image alias
+ :type alias: ``str``
+
+ :rtype: boolean
Review comment:
Looks like method actually returns a tuple, please update the comment accordingly.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Kami commented on pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Kami commented on pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#issuecomment-683432255
Thanks for addressing the feedback - changes have been merged into trunk.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Kami commented on a change in pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Kami commented on a change in pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#discussion_r470844831
##########
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:
We could probably reduce some of the duplication in those driver methods by moving some of that error handling logic to the response class.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Eis-D-Z commented on a change in pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Eis-D-Z commented on a change in pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#discussion_r464538814
##########
File path: libcloud/container/drivers/lxd.py
##########
@@ -971,6 +1073,25 @@ def list_images(self):
images.append(self.ex_get_image(fingerprint=fingerprint))
return images
+ def ex_has_image(self, alias):
+ """
+ Helper function. Returns true is the image with the
+ given alias exits on the host
+
+ :param alias: the image alias
+ :type alias: ``str``
+
+ :rtype: boolean
+ """
+
+ # get all the images existing on the host
+ images = self.list_images()
+
+ for img in images:
Review comment:
There is after all, this was overlooked, thank you for bringing it to my attention.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Kami commented on a change in pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Kami commented on a change in pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#discussion_r464069548
##########
File path: libcloud/container/drivers/lxd.py
##########
@@ -476,22 +518,47 @@ def deploy_container(self, name, image, cluster=None,
to use as basis for limits e.g. "c2.micro"
:type ex_instance_type: ``str``
+ :param ex_timeout: Timeoute
+ :type ex_timeout: ``int``
+
:rtype: :class:`libcloud.container.base.Container`
"""
+
+ if parameters:
+ parameters = json.loads(parameters)
+
+ if "mode" in parameters["source"] and \
Review comment:
You could simplify it and just do ``if parameters["source"].get("mode", None) == "pull": ...``
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Kami commented on pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Kami commented on pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#issuecomment-667667066
Thanks for the contribution - I've added some comments.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Kami commented on a change in pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Kami commented on a change in pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#discussion_r470843934
##########
File path: libcloud/container/drivers/lxd.py
##########
@@ -971,6 +1066,32 @@ def list_images(self):
images.append(self.ex_get_image(fingerprint=fingerprint))
return images
+ def ex_has_image(self, alias):
+ """
+ Helper function. Returns true and the image fingerprint
+ if the image with the given alias exits on the host.
Review comment:
exits -> exists
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Kami commented on a change in pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Kami commented on a change in pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#discussion_r464069677
##########
File path: libcloud/container/drivers/lxd.py
##########
@@ -662,10 +730,17 @@ def destroy_container(self, container, ex_timeout=default_time_out):
# Return: background operation or standard error
req = '/%s/containers/%s' % (self.version, container.name)
- response = self.connection.request(req, method='DELETE')
- response_dict = response.parse_body()
- assert_response(response_dict=response_dict, status_code=100)
+ try:
+ response = self.connection.request(req, method='DELETE')
+
+ response_dict = response.parse_body()
+ assert_response(response_dict=response_dict, status_code=100)
+ except BaseHTTPError as e:
+ # handle the case where the container is running
+ message_list = e.message.split(",")
Review comment:
I see this logic duplicated across multiple methods so it would perhaps be better to refactor it into some common method - e.g. ``_get_error_message_for_exception`` or similar.
And some tests for this method would also be good.
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Kami commented on a change in pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Kami commented on a change in pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#discussion_r464069495
##########
File path: libcloud/container/drivers/lxd.py
##########
@@ -476,22 +518,47 @@ def deploy_container(self, name, image, cluster=None,
to use as basis for limits e.g. "c2.micro"
:type ex_instance_type: ``str``
+ :param ex_timeout: Timeoute
Review comment:
Typo
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Eis-D-Z commented on pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Eis-D-Z commented on pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#issuecomment-668131195
The issues you point out in your comments have been fixed, I have also done a -f push and a lot of commits appeared. I did this to keep the correct history since most of the code here is not mine. (Earlier I hadn't figured a way to do this)
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Eis-D-Z commented on a change in pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Eis-D-Z commented on a change in pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#discussion_r476505960
##########
File path: libcloud/container/drivers/lxd.py
##########
@@ -1155,21 +1278,66 @@ def ex_get_storage_pool_volume(self, pool_id, type, name):
response_dict = response.parse_body()
assert_response(response_dict=response_dict, status_code=200)
- return self._to_storage_volume(response_dict["metadata"])
+ return self._to_storage_volume(pool_id=pool_id,
+ metadata=response_dict["metadata"])
- def ex_create_storage_pool_volume(self, pool_id, definition):
+ def ex_get_volume_by_name(self, name, vol_type="custom"):
"""
- Create a new storage volume on a given storage pool
+ Returns a storage volume that has the given name.
+ The function will loop over all storage-polls available
+ and will pick the first volume from the first storage poll
+ that matches the given name. Thus this function can be
+ quite expensive
- Operation: sync or async (when copying an existing volume)
+ :param name: The name of the volume to look for
+ :type name: str
+
+ :param vol_type: The type of the volume default is custom
+ :type vol_type: str
:return: A StorageVolume representing a storage volume
"""
+ req = '/%s/storage-pools' % self.version
+ response = self.connection.request(req)
+ response_dict = response.parse_body()
+ assert_response(response_dict=response_dict, status_code=200)
+
+ pools = response_dict['metadata']
+
+ for pool in pools:
+
+ pool_id = pool.split('/')[-1]
+
+ volumes = self.ex_list_storage_pool_volumes(pool_id=pool_id)
+
+ for vol in volumes:
+ if vol.name == name:
+ return vol
+
+ return self._to_storage_volume(pool_id=None,
Review comment:
True...
----------------------------------------------------------------
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:
users@infra.apache.org
[GitHub] [libcloud] Kami commented on pull request #1478: Update lxd driver with networks, storage pools and further refine exi…
Posted by GitBox <gi...@apache.org>.
Kami commented on pull request #1478:
URL: https://github.com/apache/libcloud/pull/1478#issuecomment-674254481
Thanks for the contribution.
It mostly looks good. I just had some clarifying questions and some code could perhaps be optimized to avoid some duplication.
----------------------------------------------------------------
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:
users@infra.apache.org