From: Venky Shankar Date: Mon, 14 Jun 2021 07:09:37 +0000 (-0400) Subject: cephfs-mirror: silence warnings when connecting via mon host X-Git-Tag: v16.2.5~42^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F41947%2Fhead;p=ceph.git cephfs-mirror: silence warnings when connecting via mon host When connecting to remote cluster via mon address, the cluster confuration file is not required. However, the mirror daemon fills up the ceph context with the cluster name resulting in the following warning in (systemctl) logs: auth: unable to find a keyring on ... These warning messages need to be silence as they can mislead the user. Fixes: http://tracker.ceph.com/issues/51204 Signed-off-by: Venky Shankar (cherry picked from commit 98a8980e863814fd1d303e062e863b54ca3184f9) --- diff --git a/src/tools/cephfs_mirror/Utils.cc b/src/tools/cephfs_mirror/Utils.cc index aafafbff9372..1a8b8e0acf39 100644 --- a/src/tools/cephfs_mirror/Utils.cc +++ b/src/tools/cephfs_mirror/Utils.cc @@ -31,7 +31,9 @@ int connect(std::string_view client_name, std::string_view cluster_name, CephContext *cct = common_preinit(iparams, CODE_ENVIRONMENT_LIBRARY, CINIT_FLAG_UNPRIVILEGED_DAEMON_DEFAULTS); - cct->_conf->cluster = cluster_name; + if (mon_host.empty()) { + cct->_conf->cluster = cluster_name; + } int r = cct->_conf.parse_config_files(nullptr, nullptr, 0); if (r < 0 && r != -ENOENT) {