Merge pull request #263 from stevekuznetsov/skuznets/command_debug

Updated some debugging statements
This commit is contained in:
Devan Goodwin 2017-01-26 08:46:24 -04:00 committed by GitHub
commit ced4e19743
2 changed files with 6 additions and 7 deletions

View file

@ -248,7 +248,7 @@ class BuilderBase(object):
'--define "_binary_filedigest_algorithm md5" %s %s %s %s '
'-ba %s' % (rpmbuild_options,
self._get_rpmbuild_dir_options(), define_dist, self._get_clean_option(), self.spec_file))
debug(cmd)
debug("Building RPMs with: \n%s".format(cmd))
try:
output = run_command_print(cmd)
except (KeyboardInterrupt, SystemExit):

View file

@ -413,12 +413,6 @@ def run_command(command, print_on_success=False):
If command fails, print status code and command output.
"""
(status, output) = getstatusoutput(command)
# ISSUE 253 - allow for better debug output
debug("Command: %s" % command)
debug("Status code: %s" % status)
debug("Command output: %s\n" % output)
if status > 0:
msgs = [
"Error running command: %s\n" % command,
@ -431,6 +425,11 @@ def run_command(command, print_on_success=False):
print("Command: %s\n" % command)
print("Status code: %s\n" % status)
print("Command output: %s\n" % output)
else:
debug("Command: %s" % command)
debug("Status code: %s" % status)
debug("Command output: %s\n" % output)
return output