import gevent
import re
import socket
+import yaml
from paramiko import SSHException
from tasks.ceph_manager import CephManager, write_conf
@contextlib.contextmanager
def ceph_crash(ctx, config):
"""
- Gather crash dumps from /var/lib/crash
+ Gather crash dumps from /var/lib/ceph/crash
"""
+
+ # 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/crash'}
+ else:
+ info_yaml['archive']['crash'] = '/var/lib/ceph/crash'
+ yaml.safe_dump(info_yaml, info_file, default_flow_style=False)
+
try:
yield
)
)
+ # 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)
+
class Rotater(object):
stop_event = gevent.event.Event()
ctx.managers[cluster].mark_down_osd(id_)
ctx.daemons.get_daemon(type_, id_, cluster).restart()
clusters.add(cluster)
-
+
if config.get('wait-for-healthy', True):
for cluster in clusters:
healthy(ctx=ctx, config=dict(cluster=cluster))