mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
qa/tasks/cephadm: refactor
Signed-off-by: Deepika Upadhyay <dupadhya@redhat.com>
This commit is contained in:
parent
2f0209ae43
commit
22b832e94e
@ -172,15 +172,9 @@ def ceph_log(ctx, config):
|
||||
cluster_name = config['cluster']
|
||||
fsid = ctx.ceph[cluster_name].fsid
|
||||
|
||||
# Add logs directory to job's info log file
|
||||
with open(os.path.join(ctx.archive, 'info.yaml'), 'r+') as info_file:
|
||||
info_yaml = yaml.safe_load(info_file)
|
||||
info_file.seek(0)
|
||||
if 'archive' not in info_yaml:
|
||||
info_yaml['archive'] = {'log': '/var/log/ceph'}
|
||||
else:
|
||||
info_yaml['archive']['log'] = '/var/log/ceph'
|
||||
yaml.safe_dump(info_yaml, info_file, default_flow_style=False)
|
||||
if ctx.archive is not None:
|
||||
update_info_yaml(ctx.archive, 'log', '/var/log/ceph')
|
||||
|
||||
|
||||
try:
|
||||
yield
|
||||
@ -290,15 +284,8 @@ def ceph_crash(ctx, config):
|
||||
cluster_name = config['cluster']
|
||||
fsid = ctx.ceph[cluster_name].fsid
|
||||
|
||||
# Add logs directory to job's info log file
|
||||
with open(os.path.join(ctx.archive, 'info.yaml'), 'r+') as info_file:
|
||||
info_yaml = yaml.safe_load(info_file)
|
||||
info_file.seek(0)
|
||||
if 'archive' not in info_yaml:
|
||||
info_yaml['archive'] = {'crash': '/var/lib/ceph/%s/crash' % fsid}
|
||||
else:
|
||||
info_yaml['archive']['crash'] = '/var/lib/ceph/%s/crash' % fsid
|
||||
yaml.safe_dump(info_yaml, info_file, default_flow_style=False)
|
||||
if ctx.archive is not None:
|
||||
update_info_yaml(ctx.archive, 'crash', '/var/lib/ceph/crash')
|
||||
|
||||
try:
|
||||
yield
|
||||
|
Loading…
Reference in New Issue
Block a user