config: make meta expansion in set_val optional

Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2012-06-01 12:44:42 -07:00
parent 72edd353f4
commit 500c72e8ee
2 changed files with 4 additions and 3 deletions

View File

@ -584,7 +584,7 @@ void md_config_t::set_val_or_die(const char *key, const char *val)
assert(ret == 0);
}
int md_config_t::set_val(const char *key, const char *val)
int md_config_t::set_val(const char *key, const char *val, bool meta)
{
Mutex::Locker l(lock);
if (!key)
@ -593,7 +593,8 @@ int md_config_t::set_val(const char *key, const char *val)
return -EINVAL;
std::string v(val);
expand_meta(v);
if (meta)
expand_meta(v);
string k(ConfFile::normalize_key_name(key));

View File

@ -121,7 +121,7 @@ public:
// Set a configuration value.
// Metavariables will be expanded.
int set_val(const char *key, const char *val);
int set_val(const char *key, const char *val, bool meta=true);
// Get a configuration value.
// No metavariables will be returned (they will have already been expanded)