aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2024-08-26 11:58:56 +0100
committerGravatar Chris Lovering <[email protected]>2024-08-26 11:58:56 +0100
commit2537ede4dd2992eb6abba0d68d848b6dc6e9e74a (patch)
treeae3121d8708f4c0cf49d7177ddb9401defd7d849
parentBump dependencies to latest (diff)
Format with new ruff rules
-rw-r--r--arthur/apis/kubernetes/pods.py6
-rw-r--r--arthur/exts/directory/ldap.py16
-rw-r--r--arthur/exts/grafana/github_team_sync.py14
-rw-r--r--arthur/exts/kubernetes/deployments.py12
-rw-r--r--arthur/exts/kubernetes/nodes.py14
-rw-r--r--arthur/pagination.py2
6 files changed, 36 insertions, 28 deletions
diff --git a/arthur/apis/kubernetes/pods.py b/arthur/apis/kubernetes/pods.py
index 926859c..5ab9b92 100644
--- a/arthur/apis/kubernetes/pods.py
+++ b/arthur/apis/kubernetes/pods.py
@@ -35,9 +35,9 @@ async def get_pod_names_from_deployment(namespace: str, deployment_name: str) ->
pod = await core_api.list_namespaced_pod(
namespace=namespace,
- label_selector=",".join([
- f"{k}={v}" for k, v in deployment.spec.selector.match_labels.items()
- ]),
+ label_selector=",".join(
+ [f"{k}={v}" for k, v in deployment.spec.selector.match_labels.items()]
+ ),
)
if not pod.items:
diff --git a/arthur/exts/directory/ldap.py b/arthur/exts/directory/ldap.py
index 1968ba9..ed5ae6e 100644
--- a/arthur/exts/directory/ldap.py
+++ b/arthur/exts/directory/ldap.py
@@ -433,13 +433,15 @@ async def setup(bot: KingArthur) -> None:
"or LDAP is disabled by config, see README.md for more."
)
return
- if not all((
- CONFIG.ldap_host,
- CONFIG.ldap_bind_password,
- CONFIG.ldap_certificate_location,
- CONFIG.keycloak_address,
- CONFIG.keycloak_password,
- )):
+ if not all(
+ (
+ CONFIG.ldap_host,
+ CONFIG.ldap_bind_password,
+ CONFIG.ldap_certificate_location,
+ CONFIG.keycloak_address,
+ CONFIG.keycloak_password,
+ )
+ ):
logger.warning(
"Not loading LDAP sync utilities as one or more LDAP environment variables"
"are not set, see README.md for more."
diff --git a/arthur/exts/grafana/github_team_sync.py b/arthur/exts/grafana/github_team_sync.py
index bd5613b..14a89d9 100644
--- a/arthur/exts/grafana/github_team_sync.py
+++ b/arthur/exts/grafana/github_team_sync.py
@@ -157,12 +157,14 @@ class GrafanaGitHubTeamSync(commands.Cog):
async def setup(bot: KingArthur) -> None:
"""Add GrafanaGitHubTeamSync cog to bot."""
- if not all((
- CONFIG.github_org,
- CONFIG.github_token,
- CONFIG.grafana_url,
- CONFIG.grafana_token,
- )):
+ if not all(
+ (
+ CONFIG.github_org,
+ CONFIG.github_token,
+ CONFIG.grafana_url,
+ CONFIG.grafana_token,
+ )
+ ):
logger.warning(
"Not loading GrafanaGitHubTeamSync team as a required config entry is missing. See README"
)
diff --git a/arthur/exts/kubernetes/deployments.py b/arthur/exts/kubernetes/deployments.py
index 8c47cd7..c072e84 100644
--- a/arthur/exts/kubernetes/deployments.py
+++ b/arthur/exts/kubernetes/deployments.py
@@ -123,11 +123,13 @@ class Deployments(commands.Cog):
else:
emote = "\N{LARGE YELLOW CIRCLE}"
- table_data.append([
- emote,
- deployment.metadata.name,
- f"{deployment.status.available_replicas or 0}/{deployment.spec.replicas}",
- ])
+ table_data.append(
+ [
+ emote,
+ deployment.metadata.name,
+ f"{deployment.status.available_replicas or 0}/{deployment.spec.replicas}",
+ ]
+ )
table = tabulate(
table_data,
diff --git a/arthur/exts/kubernetes/nodes.py b/arthur/exts/kubernetes/nodes.py
index 1a617e7..d3cb6eb 100644
--- a/arthur/exts/kubernetes/nodes.py
+++ b/arthur/exts/kubernetes/nodes.py
@@ -50,12 +50,14 @@ class Nodes(commands.Cog):
node_creation = node.metadata.creation_timestamp
- table_data.append([
- node.metadata.name,
- ", ".join(statuses),
- node.status.node_info.kubelet_version,
- node_creation,
- ])
+ table_data.append(
+ [
+ node.metadata.name,
+ ", ".join(statuses),
+ node.status.node_info.kubelet_version,
+ node_creation,
+ ]
+ )
table = tabulate(
table_data, headers=["Name", "Status", "Kubernetes Version", "Created"], tablefmt="psql"
diff --git a/arthur/pagination.py b/arthur/pagination.py
index e8e69e1..6adcbb4 100644
--- a/arthur/pagination.py
+++ b/arthur/pagination.py
@@ -24,7 +24,7 @@ class LinePaginator(_LinePaginator):
max_size: int = 500,
scale_to_size: int = 4000,
restrict_to_user: discord.User | None = None,
- timeout: int = 300, # noqa: ASYNC109
+ timeout: int = 300,
footer_text: str | None = None,
url: str | None = None,
allowed_roles: Sequence[int] | None = None,