Skip to content

Commit

Permalink
pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Milan Fencik committed Nov 25, 2024
1 parent a436485 commit a696684
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion python/neutron-understack/neutron_understack/nautobot.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def log_for_status(self, response):
except HTTPError as error:
LOG.debug("Nautobot error: %(error)s", {"error": error})

def make_api_request(self, url: str, method: str, payload: dict | None = None) -> dict:
def make_api_request(
self, url: str, method: str, payload: dict | None = None
) -> dict:
endpoint_url = urljoin(self.base_url, url)
caller_function = inspect.stack()[self.CALLER_FRAME].function
http_method = method.upper()
Expand Down
12 changes: 8 additions & 4 deletions python/neutron-understack/neutron_understack/undersync.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(
self,
auth_token: str | None = None,
api_url: str | None = None,
timeout: int = 90
timeout: int = 90,
) -> None:
"""Simple client for Undersync."""
self.token = auth_token or self.fetch_undersync_token()
Expand Down Expand Up @@ -55,9 +55,13 @@ def client(self):
return session

def undersync_post(self, action: str, uuids: str) -> requests.Response:
response = self.client.post(f"{self.api_url}/v1/vlan-group/{uuids}/{action}",
timeout=self.timeout)
LOG.debug("undersync %(action)s resp: %(resp)s", {"resp": response.json(), "action": action})
response = self.client.post(
f"{self.api_url}/v1/vlan-group/{uuids}/{action}", timeout=self.timeout
)
LOG.debug(
"undersync %(action)s resp: %(resp)s",
{"resp": response.json(), "action": action},
)
self.log_for_status(response)
return response

Expand Down

0 comments on commit a696684

Please sign in to comment.