libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [libcloud] KYDronePilot commented on a change in pull request #1373: VCloud Driver Features/Bugfixes
Date Mon, 25 Nov 2019 19:20:15 GMT
KYDronePilot commented on a change in pull request #1373: VCloud Driver Features/Bugfixes
URL: https://github.com/apache/libcloud/pull/1373#discussion_r350374580
 
 

 ##########
 File path: libcloud/compute/drivers/vcloud.py
 ##########
 @@ -992,17 +1135,31 @@ def ex_find_node(self, node_name, vdcs=None):
                 if entity_elem.get('type') == \
                         'application/vnd.vmware.vcloud.vApp+xml' and \
                         entity_elem.get('name') == node_name:
-                    path = get_url_path(entity_elem.get('href'))
-                    headers = {'Content-Type':
-                               'application/vnd.vmware.vcloud.vApp+xml'}
-                    res = self.connection.request(path,
-                                                  headers=headers)
-                    return self._to_node(res.object)
+                    path = entity_elem.get('href')
+                    return self._ex_get_node(path)
         return None
 
-    def destroy_node(self, node):
+    def ex_find_vm_nodes(self, vm_name):
+        """
+        Finds nodes that contain a VM with the specified name.
+
+        :param vm_name: The VM name to find nodes for
+        :type vm_name: ``str``
+
+        :return: List of node instances
+        :rtype: `list` of :class:`Node`
+        """
+        vms = self.ex_query(
+            'vm',
+            filter='name=={vm_name}'.format(vm_name=vm_name),
+            page=1,
+            page_size=1
 
 Review comment:
   Yes, that was something I overlooked. I have added a parameter for specifying the maximum
number of results.

----------------------------------------------------------------
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


With regards,
Apache Git Services

Mime
View raw message