]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/common/common_init.cc
import quincy beta 17.1.0
[ceph.git] / ceph / src / common / common_init.cc
index 6e6a7ecf8100eec9b4df7ffeafbf5fcaf08095c3..f3ca0326137818bba83446d8343a565e871d9d33 100644 (file)
@@ -19,6 +19,7 @@
 #include "common/ceph_context.h"
 #include "common/config.h"
 #include "common/dout.h"
+#include "common/hostname.h"
 #include "common/strtol.h"
 #include "common/valgrind.h"
 #include "common/zipkin_trace.h"
@@ -66,6 +67,9 @@ CephContext *common_preinit(const CephInitParameters &iparams,
 
   conf.set_val("no_config_file", iparams.no_config_file ? "true" : "false");
 
+  if (conf->host.empty()) {
+    conf.set_val("host", ceph_get_short_hostname());
+  }
   return cct;
 }
 #endif // #ifndef WITH_SEASTAR