MCPcopy Create free account
hub / github.com/ceph/ceph / update_archive_setting

Function update_archive_setting

qa/tasks/ceph.py:78–91  ·  view source on GitHub ↗

Add logs directory to job's info log file

(ctx, key, value)

Source from the content-addressed store, hash-verified

76
77
78def 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

Callers 2

ceph_crashFunction · 0.70
ceph_logFunction · 0.70

Calls 2

joinMethod · 0.45
seekMethod · 0.45

Tested by

no test coverage detected