Skip to content

Commit f2e00c5

Browse files
committed
Fix security issues flagged in PR #593 code scanning.
Signed-off-by: lakshmj <[email protected]>
1 parent f6ffea4 commit f2e00c5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

plugins/module_utils/las_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def get_blob_from_las(self, newactivationid, lsfingerprint, output_file, bearer,
321321

322322
def sftp_get(ip, username, password, remote_path, local_path, loglines):
323323
ssh = paramiko.SSHClient()
324-
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # nosec B507 - we want to allow connecting to new hosts without manual intervention for this use case
324+
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # nosec B507
325325
sftp = None
326326
try:
327327
ssh.connect(ip, username=username, password=password)
@@ -338,7 +338,7 @@ def sftp_get(ip, username, password, remote_path, local_path, loglines):
338338

339339
def sftp_put(ip, username, password, local_path, remote_path, loglines):
340340
ssh = paramiko.SSHClient()
341-
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # nosec B507 - we want to allow connecting to new hosts without manual intervention for this use case
341+
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) # nosec B507
342342
sftp = None
343343
try:
344344
ssh.connect(ip, port=22, username=username, password=password)
@@ -469,7 +469,7 @@ def extract_lsguid(file_path, loglines):
469469
dest_dir,
470470
]
471471
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, shell=False) # nosec B603
472-
_, stderr = proc.communicate()
472+
stdout, stderr = proc.communicate()
473473
if proc.returncode != 0:
474474
raise RuntimeError("tar extraction failed: {0}".format(stderr))
475475

0 commit comments

Comments
 (0)