Skip to content

Commit 43e91dd

Browse files
committed
Address code linter issues
Pylint released a new version with a new check on potentially unassigned variables in if/else branches. Checked that the affected variables are useful in only one of the branches and disabled the linter for those specific lines. Signed-off-by: Jacopo De Amicis <jdamicis@amazon.it>
1 parent 066ab25 commit 43e91dd

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

awsbatch-cli/src/awsbatch/awsbstat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def run(self, job_status, expand_children, job_queue=None, job_ids=None, show_de
296296
fail("Error listing jobs from AWS Batch. job_ids or job_queue must be defined")
297297

298298
sort_keys_function = self.__sort_by_status_startedat_jobid() if not job_ids else self.__sort_by_key(job_ids)
299-
if details_required:
299+
if details_required: # pylint: disable=E0606
300300
self.output.show(sort_keys_function=sort_keys_function)
301301
else:
302302
self.output.show_table(

awsbatch-cli/src/awsbatch/awsbsub.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def _upload_and_get_command(boto3_factory, args, job_s3_folder, job_name, config
245245
command = [args.command] + args.arguments
246246
else:
247247
fail("Unexpected error. Command cannot be empty.")
248-
log.info("Command: %s" % shell_join(command))
248+
log.info("Command: %s" % shell_join(command)) # pylint: disable=E0606
249249
return command
250250

251251

cli/src/pcluster/cli/commands/dcv_connect.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ def _retrieve_dcv_session_url(ssh_cmd, cluster_name, head_node_ip):
117117
raise DCVConnectionError(e.output)
118118

119119
return "https://{IP}:{PORT}?authToken={TOKEN}#{SESSION_ID}".format(
120-
IP=head_node_ip, PORT=dcv_server_port, TOKEN=dcv_session_token, SESSION_ID=dcv_session_id
120+
IP=head_node_ip,
121+
PORT=dcv_server_port, # pylint: disable=E0606
122+
TOKEN=dcv_session_token, # pylint: disable=E0606
123+
SESSION_ID=dcv_session_id, # pylint: disable=E0606
121124
)
122125

123126

cli/src/pcluster/validators/directory_service_validators.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,11 @@ def _validate(self, password_secret_arn: str, region: str):
9292
resource_type = resource.split("/")[0]
9393
if service == "secretsmanager" and resource == "secret":
9494
AWSApi.instance().secretsmanager.describe_secret(password_secret_arn)
95-
elif service == "ssm" and resource_type == "parameter" and region == "us-isob-east-1":
95+
elif (
96+
service == "ssm"
97+
and resource_type == "parameter" # pylint: disable=E0606
98+
and region == "us-isob-east-1"
99+
):
96100
parameter_name = resource.split("/")[1]
97101
AWSApi.instance().ssm.get_parameter(parameter_name)
98102
else:

0 commit comments

Comments
 (0)