예제 #1
0
def test_get_ceph_conf_filename(mocker, node, cmd_output, conf_file):
    cmd = [
        'bash', '-c',
        'pgrep ceph-mon | xargs -I{} cat /proc/{}/cmdline',
    ]
    mock_ssh = mocker.patch(
        "octane.util.ssh.call_output", return_value=cmd_output)
    assert conf_file == ceph.get_ceph_conf_filename(node)
    mock_ssh.assert_called_once_with(cmd, node=node)
예제 #2
0
def extract_mon_conf_files(orig_env, tar_filename):
    controller = env_util.get_one_controller(orig_env)
    conf_filename = ceph.get_ceph_conf_filename(controller)
    conf_dir = os.path.dirname(conf_filename)
    hostname = short_hostname(
        node_util.get_hostname_remotely(controller))
    db_path = "/var/lib/ceph/mon/ceph-{0}".format(hostname)
    node_util.tar_files(tar_filename, controller, conf_dir, db_path)
    return conf_filename, db_path