Skip to content

Commit 0148618

Browse files
committed
Reformat code with black.
1 parent 2d18970 commit 0148618

6 files changed

Lines changed: 3 additions & 36 deletions

File tree

contrib/generate_contributor_list.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ def parse_changes_file(file_path, versions=None):
8787
active_tickets = active_tickets.split(", ")
8888
active_tickets = [
8989
ticket
90-
9190
for ticket in active_tickets
92-
9391
if ticket.startswith("LIBCLOUD-") or ticket.startswith("GITHUB-")
9492
]
9593

libcloud/compute/drivers/equinixmetal.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,6 @@ def _to_size(self, data):
530530
cpus = None
531531
regions = [
532532
region.get("href").replace("/metal/v1/locations/metros", "")
533-
534533
for region in data.get("available_in_metros", [])
535534
]
536535
extra = {
@@ -717,9 +716,7 @@ def ex_describe_all_addresses_for_project(
717716
ip_addresses = self.connection.request(path, params=params).object
718717
result = [
719718
a
720-
721719
for a in ip_addresses.get("ip_addresses", [])
722-
723720
if not only_associated or len(a.get("assignments", [])) > 0
724721
]
725722

libcloud/compute/drivers/gce.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6447,7 +6447,6 @@ def ex_targetpool_add_node(self, targetpool, node):
64476447

64486448
if all(
64496449
(node_uri != n) and (not hasattr(n, "extra") or n.extra["selfLink"] != node_uri)
6450-
64516450
for n in targetpool.nodes
64526451
):
64536452
targetpool.nodes.append(node)
@@ -10565,7 +10564,6 @@ def _to_urlmap(self, urlmap):
1056510564
"""
1056610565
extra = {
1056710566
k: urlmap.get(k)
10568-
1056910567
for k in ("creationTimestamp", "description", "fingerprint", "selfLink")
1057010568
}
1057110569

libcloud/compute/drivers/nttcis.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5579,7 +5579,6 @@ def _to_node(self, element):
55795579
"networkId": findtext(element, "networkId", TYPES_URN),
55805580
"networkDomainId": (
55815581
element.find(fixxpath("networkInfo", TYPES_URN)).get("networkDomainId")
5582-
55835582
if has_network_info
55845583
else None
55855584
),
@@ -5590,7 +5589,6 @@ def _to_node(self, element):
55905589
element.find(fixxpath("snapshotService/window", TYPES_URN)).get("dayOfWeek"),
55915590
element.find(fixxpath("snapshotService/window", TYPES_URN)).get("startHour"),
55925591
)
5593-
55945592
if has_snapshot
55955593
else None
55965594
),
@@ -5609,14 +5607,12 @@ def _to_node(self, element):
56095607

56105608
private_ip = (
56115609
element.find(fixxpath("networkInfo/primaryNic", TYPES_URN)).get("privateIpv4")
5612-
56135610
if has_network_info
56145611
else element.find(fixxpath("nic", TYPES_URN)).get("privateIpv4")
56155612
)
56165613

56175614
extra["ipv6"] = (
56185615
element.find(fixxpath("networkInfo/primaryNic", TYPES_URN)).get("ipv6")
5619-
56205616
if has_network_info
56215617
else element.find(fixxpath("nic", TYPES_URN)).get("ipv6")
56225618
)

libcloud/compute/drivers/vcloud.py

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

libcloud/compute/drivers/vsphere.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ def list_locations(self, ex_show_hosts_in_drs=True):
168168

169169
potential_locations = [
170170
dc
171-
172171
for dc in content.viewManager.CreateContainerView(
173172
content.rootFolder,
174173
[vim.ClusterComputeResource, vim.HostSystem],
@@ -755,7 +754,6 @@ def _to_node_recursive(self, virtual_machine):
755754
"created": s.createTime.strftime("%Y-%m-%d %H:%M"),
756755
"state": s.state,
757756
}
758-
759757
for s in virtual_machine.snapshot.rootSnapshotList
760758
]
761759
extra["snapshots"] = snapshots
@@ -1421,7 +1419,6 @@ async def _list_nodes_async(self, vm_ids, interfaces):
14211419
loop = asyncio.get_event_loop()
14221420
vms = [
14231421
loop.run_in_executor(None, self._to_node, vm_ids[i], interfaces)
1424-
14251422
for i in range(len(vm_ids))
14261423
]
14271424

@@ -1442,14 +1439,12 @@ async def _get_all_vms(self):
14421439
None,
14431440
functools.partial(self.ex_list_hosts, ex_filter_datacenters=datacenter["id"]),
14441441
)
1445-
14461442
for datacenter in datacenters
14471443
]
14481444
hosts = await asyncio.gather(*hosts_futures)
14491445

14501446
vm_resp_futures = [
14511447
loop.run_in_executor(None, functools.partial(self._get_vms_with_host, host))
1452-
14531448
for host in itertools.chain(*hosts)
14541449
]
14551450

@@ -1598,7 +1593,6 @@ def _list_interfaces(self):
15981593
"status": interface["status"],
15991594
"ip": interface["ipv4"]["address"],
16001595
}
1601-
16021596
for interface in response
16031597
]
16041598

0 commit comments

Comments
 (0)