Skip to content

Commit

Permalink
debugging message
Browse files Browse the repository at this point in the history
  • Loading branch information
scrasmussen committed Jul 26, 2024
1 parent d324966 commit ccfd8e0
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scm/src/run_scm.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,17 @@ def execute(cmd, ignore_error = False):
stderr = subprocess.PIPE, shell = True)
(stdout, stderr) = p.communicate()
status = p.returncode
message = 'Execution of "{0}" returned with exit code {1}\n'.format(cmd, status)
message += ' stdout: "{0}"\n'.format(stdout.decode(encoding='ascii', errors='ignore').rstrip('\n'))
message += ' stderr: "{0}"'.format(stderr.decode(encoding='ascii', errors='ignore').rstrip('\n'))
print("DEBUGGING message:",message)
if status == 0:
message = 'Execution of "{0}" returned with exit code {1}\n'.format(cmd, status)
message += ' stdout: "{0}"\n'.format(stdout.decode(encoding='ascii', errors='ignore').rstrip('\n'))
message += ' stderr: "{0}"'.format(stderr.decode(encoding='ascii', errors='ignore').rstrip('\n'))
logging.debug(message)
elif not ignore_error:
message = 'Execution of command "{0}" failed, exit code {1}\n'.format(cmd, status)
message += ' stdout: "{0}"\n'.format(stdout.decode(encoding='ascii', errors='ignore').rstrip('\n'))
message += ' stderr: "{0}"'.format(stderr.decode(encoding='ascii', errors='ignore').rstrip('\n'))
logging.critical(message)
raise Exception('Execution of command "{0}" failed, exit code {1}\n'.format(cmd, status))
else:
logging.error(message)
return (status, stdout.decode(encoding='ascii', errors='ignore').rstrip('\n'), stderr.decode(encoding='ascii', errors='ignore').rstrip('\n'))

def parse_arguments():
Expand Down

0 comments on commit ccfd8e0

Please sign in to comment.