Skip to content

Commit d8cb5a7

Browse files
committed
log the output of failed command
1 parent 975b9a5 commit d8cb5a7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

tools/sync/opengrok.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,16 @@ def get_repos(logger, project, messages_file):
5050

5151

5252
def get_first_line(logger, command):
53+
"""
54+
Execute given command and return the first line of its output
55+
or None if the execution failed.
56+
"""
57+
5358
cmd = Command(command)
5459
cmd.execute()
5560
if cmd.state is not "finished" or cmd.getretcode() != 0:
56-
logger.error("execution of command '{}' failed".format(cmd))
61+
logger.error("execution of command '{}' failed with: {}"
62+
.format(cmd, cmd.getoutputstr()))
5763
return None
5864

5965
if len(cmd.getoutput()) != 1:

0 commit comments

Comments
 (0)