@@ -572,9 +572,7 @@ def vdcs(self):
572572 res = self .connection .request (self .org )
573573 self ._vdcs = [
574574 self ._to_vdc (self .connection .request (get_url_path (i .get ("href" ))).object )
575-
576575 for i in res .object .findall (fixxpath (res .object , "Link" ))
577-
578576 if i .get ("type" ) == "application/vnd.vmware.vcloud.vdc+xml"
579577 ]
580578
@@ -661,9 +659,7 @@ def _get_catalog_hrefs(self):
661659 res = self .connection .request (self .org )
662660 catalogs = [
663661 i .get ("href" )
664-
665662 for i in res .object .findall (fixxpath (res .object , "Link" ))
666-
667663 if i .get ("type" ) == "application/vnd.vmware.vcloud.catalog+xml"
668664 ]
669665
@@ -756,9 +752,7 @@ def ex_list_nodes(self, vdcs=None):
756752 elms = res .object .findall (fixxpath (res .object , "ResourceEntities/ResourceEntity" ))
757753 vapps = [
758754 (i .get ("name" ), i .get ("href" ))
759-
760755 for i in elms
761-
762756 if i .get ("type" ) == "application/vnd.vmware.vcloud.vApp+xml" and i .get ("name" )
763757 ]
764758
@@ -810,9 +804,7 @@ def _get_catalogitems_hrefs(self, catalog):
810804 cat_items = res .findall (fixxpath (res , "CatalogItems/CatalogItem" ))
811805 cat_item_hrefs = [
812806 i .get ("href" )
813-
814807 for i in cat_items
815-
816808 if i .get ("type" ) == "application/vnd.vmware.vcloud.catalogItem+xml"
817809 ]
818810
@@ -835,9 +827,7 @@ def list_images(self, location=None):
835827 res_ents = res .findall (fixxpath (res , "ResourceEntities/ResourceEntity" ))
836828 images += [
837829 self ._to_image (i )
838-
839830 for i in res_ents
840-
841831 if i .get ("type" ) == "application/vnd.vmware.vcloud.vAppTemplate+xml"
842832 ]
843833
@@ -847,9 +837,7 @@ def list_images(self, location=None):
847837 res_ents = res .findall (fixxpath (res , "Entity" ))
848838 images += [
849839 self ._to_image (i )
850-
851840 for i in res_ents
852-
853841 if i .get ("type" ) == "application/vnd.vmware.vcloud.vAppTemplate+xml"
854842 ]
855843
@@ -1035,9 +1023,7 @@ def _get_auth_token(self):
10351023 org_list_url = get_url_path (
10361024 next (
10371025 link
1038-
10391026 for link in body .findall (fixxpath (body , "Link" ))
1040-
10411027 if link .get ("type" ) == "application/vnd.vmware.vcloud.orgList+xml"
10421028 ).get ("href" )
10431029 )
@@ -1053,9 +1039,7 @@ def _get_auth_token(self):
10531039 self .driver .org = get_url_path (
10541040 next (
10551041 org
1056-
10571042 for org in body .findall (fixxpath (body , "Org" ))
1058-
10591043 if org .get ("name" ) == self .org_name
10601044 ).get ("href" )
10611045 )
@@ -1489,7 +1473,9 @@ def ex_set_control_access(self, node, control_access):
14891473
14901474 if not res :
14911475 raise LibcloudError (
1492- 'Specified subject "{} {}" not found ' .format (subject .type , subject .name )
1476+ 'Specified subject "{} {}" not found ' .format (
1477+ subject .type , subject .name
1478+ )
14931479 )
14941480 href = res [0 ]["href" ]
14951481 ET .SubElement (setting , "Subject" , {"href" : href })
@@ -2513,9 +2499,7 @@ def _to_node(self, node_elm):
25132499 # Find vDC
25142500 vdc_id = next (
25152501 link .get ("href" )
2516-
25172502 for link in node_elm .findall (fixxpath (node_elm , "Link" ))
2518-
25192503 if link .get ("type" ) == "application/vnd.vmware.vcloud.vdc+xml"
25202504 ) # pylint: disable=no-member
25212505 vdc = next (vdc for vdc in self .vdcs if vdc .id == vdc_id )
0 commit comments