Skip to content

Commit 157cc6b

Browse files
committed
fix style check errors
1 parent de30ba8 commit 157cc6b

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

src/aks-agent/azext_aks_agent/_client_factory.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
# --------------------------------------------------------------------------------------------
55

66
from azure.cli.core.commands.client_factory import get_mgmt_service_client
7-
from azure.cli.core.commands.parameters import get_resources_in_subscription
8-
from azure.cli.core.profiles import CustomResourceType, ResourceType
9-
from azure.mgmt.msi import ManagedServiceIdentityClient
10-
from knack.util import CLIError
7+
from azure.cli.core.profiles import CustomResourceType
118

129
CUSTOM_MGMT_AKS = CustomResourceType('azext_aks_agent.vendored_sdks.azure_mgmt_containerservice.2025_10_01',
1310
'ContainerServiceClient')

src/aks-agent/azext_aks_agent/agent/aks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def get_aks_credentials(
4646
return kubeconfig_path
4747

4848

49-
def _get_kubeconfig_file_path(
49+
def _get_kubeconfig_file_path( # pylint: disable=unused-argument
5050
resource_group_name: str,
5151
cluster_name: str,
5252
subscription_id: str = None

src/aks-agent/azext_aks_agent/agent/k8s/aks_agent_manager.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
)
1616
from azext_aks_agent.agent.k8s.helm_manager import HelmManager
1717
from azext_aks_agent.agent.llm_config_manager import LLMConfigManager
18-
from azure.cli.core import get_default_cli
1918
from azure.cli.core.azclierror import AzCLIError
2019
from knack.log import get_logger
2120
from kubernetes import client, config
@@ -219,14 +218,15 @@ def get_agent_pods(self) -> Tuple[bool, Union[List[str], str]]:
219218
all_pod_items = list(agent_pods.items) + list(mcp_pods.items)
220219

221220
# Create a pod_list-like object with combined items
222-
class PodList:
221+
class PodList: # pylint: disable=too-few-public-methods
223222
def __init__(self, items):
224223
self.items = items
225224
pod_list = PodList(all_pod_items)
226225

227226
if not pod_list.items:
228227
error_msg = (
229-
f"No pods found with label selector '{AGENT_LABEL_SELECTOR}' or '{AKS_MCP_LABEL_SELECTOR}' in namespace '{self.namespace}'. "
228+
f"No pods found with label selector '{AGENT_LABEL_SELECTOR}' or "
229+
f"'{AKS_MCP_LABEL_SELECTOR}' in namespace '{self.namespace}'. "
230230
f"This could mean:\n"
231231
f" 1. The AKS agent is not deployed in the cluster\n"
232232
f" 2. The namespace '{self.namespace}' does not exist\n"
@@ -295,7 +295,8 @@ def __init__(self, items):
295295
status_summary = "; ".join(status_details) if status_details else "all pods are in unknown state"
296296

297297
error_msg = (
298-
f"No running pods found with label selector '{AGENT_LABEL_SELECTOR}' or '{AKS_MCP_LABEL_SELECTOR}' in namespace '{self.namespace}'. "
298+
f"No running pods found with label selector '{AGENT_LABEL_SELECTOR}' or "
299+
f"'{AKS_MCP_LABEL_SELECTOR}' in namespace '{self.namespace}'. "
299300
f"Found {len(pod_list.items)} pod(s) but none are in Running state: {status_summary}. "
300301
f"The AKS agent pods may be starting up, failing to start, or experiencing issues."
301302
)
@@ -401,7 +402,7 @@ def deploy_agent(self, chart_version: Optional[str] = None,
401402

402403
return False, output
403404

404-
def get_agent_status(self) -> Dict:
405+
def get_agent_status(self) -> Dict: # pylint: disable=too-many-locals
405406
"""
406407
Get the current status of AKS agent deployment.
407408
@@ -491,7 +492,7 @@ def get_agent_status(self) -> Dict:
491492
all_pods = list(agent_pods.items) + list(mcp_pods.items)
492493

493494
# Create a pods-like object with combined items
494-
class PodList:
495+
class PodList: # pylint: disable=too-few-public-methods
495496
def __init__(self, items):
496497
self.items = items
497498
pods = PodList(all_pods)
@@ -560,10 +561,9 @@ def check_llm_config_exists(self) -> bool:
560561
logger.debug("LLM config secret '%s' not found in namespace '%s'",
561562
self.llm_secret_name, self.namespace)
562563
return False
563-
else:
564-
logger.error("Failed to check LLM config existence (API error %s): %s",
565-
e.status, e)
566-
raise
564+
logger.error("Failed to check LLM config existence (API error %s): %s",
565+
e.status, e)
566+
raise
567567
except Exception as e: # pylint: disable=broad-exception-caught
568568
logger.error("Unexpected error checking LLM config existence: %s", e)
569569
raise AzCLIError(f"Failed to check LLM config existence: {e}")

src/aks-agent/azext_aks_agent/agent/llm_config_manager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
# --------------------------------------------------------------------------------------------
55

66

7-
from typing import Dict, List, Optional
7+
from typing import Dict, List
88

99
from azext_aks_agent.agent.llm_providers import LLMProvider
10-
from azure.cli.core.azclierror import AzCLIError
1110
from knack.log import get_logger
1211

1312
logger = get_logger(__name__)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# --------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)