Skip to content

Commit 77ac7cd

Browse files
authored
Tidying - ruff and type annotations fix (#25)
* ruff fix * remove duplicate code block * cleaner fix for no existing kubeconfig makes the type annotations true again
1 parent e92fe03 commit 77ac7cd

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/connectedk8s/azext_connectedk8s/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def load_arguments(self, command: CLICommand) -> None:
4343
COMMAND_LOADER_CLS = Connectedk8sCommandsLoader
4444

4545
__all__ = [
46-
"helps",
47-
"Connectedk8sCommandsLoader",
4846
"COMMAND_LOADER_CLS",
47+
"Connectedk8sCommandsLoader",
48+
"helps",
4949
]

src/connectedk8s/azext_connectedk8s/custom.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2289,10 +2289,6 @@ def update_connected_cluster(
22892289
if disable_proxy:
22902290
helm_content_values["global.isProxyEnabled"] = "False"
22912291

2292-
# Disable proxy if disable_proxy flag is set
2293-
if disable_proxy:
2294-
helm_content_values["global.isProxyEnabled"] = "False"
2295-
22962292
# Set agent version in registry path
22972293
if connected_cluster.agent_version is not None:
22982294
agent_version = connected_cluster.agent_version # type: ignore[unreachable]
@@ -3271,7 +3267,7 @@ def disable_cluster_connect(
32713267
def load_kubernetes_configuration(filename: str) -> dict[str, Any]:
32723268
try:
32733269
with open(filename) as stream:
3274-
k8s_config: dict[str, Any] = yaml.safe_load(stream)
3270+
k8s_config: dict[str, Any] = yaml.safe_load(stream) or {}
32753271
return k8s_config
32763272
except OSError as ex:
32773273
if getattr(ex, "errno", 0) == errno.ENOENT:
@@ -3372,8 +3368,8 @@ def merge_kubernetes_configurations(
33723368
break
33733369
except (KeyError, TypeError):
33743370
continue
3375-
3376-
if existing is None:
3371+
3372+
if not existing:
33773373
existing = addition
33783374
else:
33793375
handle_merge(existing, addition, "clusters", replace)

0 commit comments

Comments
 (0)