Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions src/core/src/bootstrap/EnvLayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@
print("Error occurred while getting environment variable [Variable={0}][Exception={1}]".format(str(var_name), repr(error)))
if raise_if_not_success:
raise
return None

def run_command_output(self, cmd, no_output, chk_err=True):
def run_command_output(self, cmd, no_output=False, chk_err=True):
# type: (str, bool, bool) -> (int, any)
""" Wrapper for subprocess.check_output. Execute 'cmd'. Returns return code and STDOUT, trapping expected exceptions. Reports exceptions to Error if chk_err parameter is True """

Expand Down Expand Up @@ -185,7 +186,7 @@
output = subprocess.check_output(no_output, cmd, stderr=subprocess.STDOUT, shell=True)
except subprocess.CalledProcessError as e:
if chk_err:
print("Error: CalledProcessError. [Code={0}][Command={1}][Result={2}]".format(str(e.returncode), e.cmd, self.__convert_process_output_to_ascii(e.output[:-1])), file=sys.stdout)
print("Error: CalledProcessError. [Code={0}][Command={1}][Result={2}]".format(str(e.return_code), e.cmd, self.__convert_process_output_to_ascii(e.output[:-1])), file=sys.stdout)

Check warning on line 189 in src/core/src/bootstrap/EnvLayer.py

View check run for this annotation

Codecov / codecov/patch

src/core/src/bootstrap/EnvLayer.py#L189

Added line #L189 was not covered by tests
if no_output:
return e.return_code, None
else:
Expand Down
2 changes: 1 addition & 1 deletion src/extension/src/EnvLayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
no_output, cmd, stderr=subprocess.STDOUT, shell=True)
except subprocess.CalledProcessError as e:
if chk_err:
print("Error: CalledProcessError. Error Code is: " + str(e.returncode), file=sys.stdout)
print("Error: CalledProcessError. Error Code is: " + str(e.return_code), file=sys.stdout)

Check warning on line 100 in src/extension/src/EnvLayer.py

View check run for this annotation

Codecov / codecov/patch

src/extension/src/EnvLayer.py#L100

Added line #L100 was not covered by tests
print("Error: CalledProcessError. Command string was: " + e.cmd, file=sys.stdout)
print("Error: CalledProcessError. Command result was: " + self.__convert_process_output_to_ascii(e.output[:-1]), file=sys.stdout)
if no_output:
Expand Down