Skip to content

Commit

Permalink
style: flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
JossWhittle committed Mar 21, 2024
1 parent da6395e commit fc24ae2
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

import json
import logging
from urllib.parse import quote

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def api_get_connection(
logging.debug(f"{response=}")
return response


def api_get_connection_parameters(
hostname: str,
port: int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def api_list_connections(
data_source: str
) -> dict:

logging.debug(f"List connections")
logging.debug("List connections")
response = requests.get(
build_url(
scheme="http",
Expand Down
1 change: 1 addition & 0 deletions containers/controller/src/controller/api/error.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
class APIUserDoesNotExistError(RuntimeError):
pass


class APIConnectionDoesNotExistError(RuntimeError):
pass
2 changes: 0 additions & 2 deletions containers/controller/src/controller/api/users/delete.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@

import json
import logging
from urllib.parse import quote

Expand Down
2 changes: 1 addition & 1 deletion containers/controller/src/controller/api/users/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def api_list_users(
data_source: str
) -> dict:

logging.debug(f"List users")
logging.debug("List users")
response = requests.get(
build_url(
scheme="http",
Expand Down
12 changes: 2 additions & 10 deletions containers/controller/src/controller/api/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def list_users(self):
data_source=self.data_source
)


def get_user(self, username: str):
# logging.info(f"Get user {username=}")
return api_get_user(
Expand All @@ -67,7 +66,6 @@ def get_user(self, username: str):
username=username
)


def get_user_effective_permissions(self, username: str):
# logging.info(f"Get user effective permissions {username=}")
return api_get_user_effective_permissions(
Expand Down Expand Up @@ -103,7 +101,6 @@ def create_user(
role=role
)


def update_user(
self,
username: str,
Expand Down Expand Up @@ -213,7 +210,6 @@ def get_connection(self, conn_id: int):
conn_id=conn_id
)


def get_connection_parameters(self, conn_id: int):
# logging.info(f"Get connection parameters {conn_id=}")
return api_get_connection_parameters(
Expand All @@ -224,7 +220,6 @@ def get_connection_parameters(self, conn_id: int):
conn_id=conn_id
)


def create_connection(
self,
name: str,
Expand All @@ -249,7 +244,6 @@ def create_connection(

return response["identifier"]


def update_connection(
self,
conn_id: int,
Expand Down Expand Up @@ -285,8 +279,8 @@ def create_or_update_connection(
try:
conn_id = self.get_connection_id(conn_name=name)

connection = self.get_connection(conn_id=conn_id)
connection_parameters = self.get_connection_parameters(conn_id=conn_id)
# connection = self.get_connection(conn_id=conn_id)
# connection_parameters = self.get_connection_parameters(conn_id=conn_id)

# TODO determine if connection needs updating
needs_update = True
Expand All @@ -307,7 +301,6 @@ def create_or_update_connection(
# else:
# logging.info(f"Skipping updating connection {name=}")


except APIConnectionDoesNotExistError:

return self.create_connection(
Expand Down Expand Up @@ -358,7 +351,6 @@ def delete_user_connection(
conn_id=conn_id,
)


def list_connection_users(
self,
conn_id: int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def sync_connections(
# Add connections via api
for manifest_name, manifest in manifests.items():


name = manifest["metadata"]["name"]
namespace = manifest["metadata"]["namespace"]

Expand Down
2 changes: 0 additions & 2 deletions containers/controller/src/controller/sync/sync_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from .get_unique_users import get_unique_users
from ..api import API
from ..directory import LDAP


def sync_users(
Expand Down Expand Up @@ -31,4 +30,3 @@ def sync_users(
for observed_user in observed_users.values():
if (observed_user["username"] not in expected_users) and (observed_user["username"] != api.username):
api.delete_user(username=observed_user["username"])

0 comments on commit fc24ae2

Please sign in to comment.