Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

CORTX-33346: Codacy Code cleanup #2032

Merged
merged 1 commit into from
Aug 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def execute_command_without_log(cmd, timeout_secs = TIMEOUT_SECS,
verbose = False, retries = 1, stdin = None, logging=False):
ps = subprocess.Popen(cmd, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
shell=True)
shell=False)
if stdin:
ps.stdin.write(stdin.encode())
stdout, stderr = ps.communicate(timeout=timeout_secs);
Expand Down Expand Up @@ -154,7 +154,7 @@ def execute_command_verbose(self, cmd, timeout_secs = TIMEOUT_SECS, verbose = Fa
for cmd_retry_count in range(retry_count):
ps = subprocess.run(cmd, stdin=subprocess.PIPE, check=False,
stdout=subprocess.PIPE, timeout=timeout_secs,
stderr=subprocess.PIPE, shell=True)
stderr=subprocess.PIPE, shell=False)
self.logger.debug(f"ret={ps.returncode}")
self.logger.debug(f"Executing {cmd_retry_count} time")
stdout = ps.stdout.decode('utf-8')
Expand Down