This function will updates process stats Args: kwargs - Process configuration details Returns: None
(**kw)
| 246 | |
| 247 | |
| 248 | def update_status(**kw): |
| 249 | """ |
| 250 | This function will updates process stats |
| 251 | |
| 252 | Args: |
| 253 | kwargs - Process configuration details |
| 254 | |
| 255 | Returns: |
| 256 | None |
| 257 | """ |
| 258 | import json |
| 259 | |
| 260 | if _out_dir: |
| 261 | status = dict( |
| 262 | (k, v) for k, v in kw.items() |
| 263 | if k in ('start_time', 'end_time', 'exit_code', 'pid') |
| 264 | ) |
| 265 | _log('Updating the status:\n{0}'.format(json.dumps(status))) |
| 266 | with open(os.path.join(_out_dir, 'status'), 'w') as fp: |
| 267 | json.dump(status, fp) |
| 268 | else: |
| 269 | raise ValueError("Please verify pid and db_file arguments.") |
| 270 | |
| 271 | |
| 272 | def _handle_execute_exception(ex, args, _stderr, exit_code=None): |