Add logs directory to job's info log file
(ctx, key, value)
| 76 | |
| 77 | |
| 78 | def update_archive_setting(ctx, key, value): |
| 79 | """ |
| 80 | Add logs directory to job's info log file |
| 81 | """ |
| 82 | if ctx.archive is None: |
| 83 | return |
| 84 | with open(os.path.join(ctx.archive, 'info.yaml'), 'r+') as info_file: |
| 85 | info_yaml = yaml.safe_load(info_file) |
| 86 | info_file.seek(0) |
| 87 | if 'archive' in info_yaml: |
| 88 | info_yaml['archive'][key] = value |
| 89 | else: |
| 90 | info_yaml['archive'] = {key: value} |
| 91 | yaml.safe_dump(info_yaml, info_file, default_flow_style=False) |
| 92 | |
| 93 | |
| 94 | @contextlib.contextmanager |
no test coverage detected