Skip to content

Commit

Permalink
Use 'exitcode' and report 'isSuccess'
Browse files Browse the repository at this point in the history
  • Loading branch information
rageshkrishna committed Jan 15, 2016
1 parent 60f43c1 commit 301d093
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
Binary file modified dist/main/main
Binary file not shown.
21 changes: 9 additions & 12 deletions script_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ def __command_runner(self, cmd, working_dir, result):
'type': 'grp',
'message': current_group_name,
'timestamp': self.__get_timestamp(),
'completed': False,
'isShown': show_group
}
self.handle_console_output(console_out)
Expand All @@ -173,7 +172,6 @@ def __command_runner(self, cmd, working_dir, result):
'type': 'cmd',
'message': current_cmd_name,
'timestamp': self.__get_timestamp(),
'completed': False
}
if parent_id:
self.handle_console_output(console_out)
Expand All @@ -182,33 +180,33 @@ def __command_runner(self, cmd, working_dir, result):
current_cmd_end_name = '|'.join(line_split[2:])
current_cmd_end_info = json.loads(current_cmd_end_info)
parent_id = current_group_info.get('id') if current_group_info else None
is_completed = False
if current_cmd_end_info.get('completed') == '0':
is_completed = True
is_success = False
if current_cmd_end_info.get('exitcode') == '0':
is_success = True
console_out = {
'consoleId': current_cmd_info.get('id'),
'parentConsoleId': parent_id,
'type': 'cmd',
'message': current_cmd_end_name,
'timestamp': self.__get_timestamp(),
'completed': is_completed
'isSuccess': is_success
}
if parent_id:
self.handle_console_output(console_out)
elif line.startswith('__SH__GROUP__END__'):
current_grp_end_info = line_split[1]
current_grp_end_name = '|'.join(line_split[2:])
current_grp_end_info = json.loads(current_grp_end_info)
is_completed = False
if current_grp_end_info.get('completed') == '0':
is_completed = True
is_success = False
if current_grp_end_info.get('exitcode') == '0':
is_success = True
console_out = {
'consoleId': current_group_info.get('id'),
'parentConsoleId': '',
'type': 'grp',
'message': current_grp_end_name,
'timestamp': self.__get_timestamp(),
'completed': is_completed
'isSuccess': is_success
}
self.handle_console_output(console_out)
elif line.startswith('__SH__SCRIPT_END_SUCCESS__'):
Expand All @@ -222,7 +220,7 @@ def __command_runner(self, cmd, working_dir, result):
'type': 'grp',
'message': current_group_name,
'timestamp': self.__get_timestamp(),
'completed': False
'isSuccess': False
}
self.handle_console_output(console_out)
success = False
Expand All @@ -240,7 +238,6 @@ def __command_runner(self, cmd, working_dir, result):
'type': 'msg',
'message': line,
'timestamp': self.__get_timestamp(),
'completed': False
}
if parent_id:
self.handle_console_output(console_out)
Expand Down

0 comments on commit 301d093

Please sign in to comment.