]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: Add cctid meta variable 2526/head
authorAdam Crume <adamcrume@gmail.com>
Thu, 18 Sep 2014 23:57:27 +0000 (16:57 -0700)
committerAdam Crume <adamcrume@gmail.com>
Thu, 18 Sep 2014 23:57:27 +0000 (16:57 -0700)
Fixes: #6228
Signed-off-by: Adam Crume <adamcrume@gmail.com>
src/common/config.cc

index a968cb77a694aa6a4bd5c1ef89074ae44329ac5e..88f443d86e06cec1bd3081886946450774c0f6d6 100644 (file)
@@ -947,7 +947,7 @@ int md_config_t::set_val_raw(const char *val, const config_option *opt)
 }
 
 static const char *CONF_METAVARIABLES[] =
-  { "cluster", "type", "name", "host", "num", "id", "pid" };
+  { "cluster", "type", "name", "host", "num", "id", "pid", "cctid" };
 static const int NUM_CONF_METAVARIABLES =
       (sizeof(CONF_METAVARIABLES) / sizeof(CONF_METAVARIABLES[0]));
 
@@ -1059,6 +1059,8 @@ bool md_config_t::expand_meta(std::string &origval,
          out += name.get_id().c_str();
        else if (var == "pid")
          out += stringify(getpid());
+       else if (var == "cctid")
+         out += stringify((unsigned long long)this);
        else
          assert(0); // unreachable
        expanded = true;