Skip to content

Commit b001130

Browse files
committed
Ruff format python code
1 parent 753f301 commit b001130

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

python/understack-workflows/tests/test_sync_keystone.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ def test_parse_object_id(arg_list, context, expected_id):
4242
assert args.object == expected_id
4343

4444

45-
4645
def test_create_project(
4746
os_conn,
4847
nautobot,

python/understack-workflows/understack_workflows/bmc_chassis_info.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ def combine_lldp(lldp, interface) -> InterfaceInfo:
100100
lldp_entry = lldp.get(name, lldp.get(alternate_name, {}))
101101
if not lldp_entry:
102102
logger.info(
103-
"LLDP info from BMC is missing for %s or %s, "
104-
"we only have LLDP info for %s",
103+
"LLDP info from BMC is missing for %s or %s, we only have LLDP info for %s",
105104
name,
106105
alternate_name,
107106
list(lldp.keys()),

python/understack-workflows/understack_workflows/bmc_credentials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def _redfish_request(
144144
)
145145
if response.status_code >= 400:
146146
raise Exception(
147-
f"Redfish HTTP {response.status_code} " f"from {uri}: {response.text}"
147+
f"Redfish HTTP {response.status_code} from {uri}: {response.text}"
148148
)
149149

150150
else:

python/understack-workflows/understack_workflows/main/sync_keystone.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import argparse
22
import logging
3-
from typing import Any
43
import uuid
54
from enum import StrEnum
65

@@ -94,6 +93,7 @@ def _find_outside_network(conn: Connection, project_id: str):
9493
name_or_id=OUTSIDE_NETWORK_NAME,
9594
)
9695

96+
9797
def _tenant_attrs(conn: Connection, project_id: uuid.UUID) -> tuple[str, str]:
9898
project = conn.identity.get_project(project_id.hex) # type: ignore
9999
domain_id = project.domain_id
@@ -107,6 +107,7 @@ def _tenant_attrs(conn: Connection, project_id: uuid.UUID) -> tuple[str, str]:
107107
tenant_name = f"{domain_name}:{project.name}"
108108
return tenant_name, str(project.description)
109109

110+
110111
def handle_project_create(
111112
conn: Connection, nautobot: Nautobot, project_id: uuid.UUID
112113
) -> int:
@@ -116,9 +117,7 @@ def handle_project_create(
116117
nautobot_tenant_api = nautobot.session.tenancy.tenants
117118
try:
118119
tenant = nautobot_tenant_api.create(
119-
id=str(project_id),
120-
name=tenant_name,
121-
description=tenant_description
120+
id=str(project_id), name=tenant_name, description=tenant_description
122121
)
123122
_create_outside_network(conn, project_id)
124123
except Exception:
@@ -147,8 +146,8 @@ def handle_project_update(
147146
)
148147
logger.info("tenant %s created %s", project_id, new_tenant.created) # type: ignore
149148
else:
150-
existing_tenant.name = tenant_name # type: ignore
151-
existing_tenant.description = tenant_description # type: ignore
149+
existing_tenant.name = tenant_name # type: ignore
150+
existing_tenant.description = tenant_description # type: ignore
152151
existing_tenant.save() # type: ignore
153152
logger.info(
154153
"tenant %s last updated %s",

0 commit comments

Comments
 (0)