]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common: expand meta in parse_argv() 23474/head
authorKefu Chai <kchai@redhat.com>
Tue, 7 Aug 2018 15:55:30 +0000 (23:55 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 7 Aug 2018 16:33:29 +0000 (00:33 +0800)
commit2a565ee35d8079c0f865355f6cc3f4163f2598d3
treec7e9749d4d4f4befec48c10c6f2a814cb7e8c7f7
parent16922bea462629259e4cb2c6a574a389684ad5fe
common: expand meta in parse_argv()

it fixes the issue where the conf->foo fails to expand if it is set
as "$bar" in a .conf file, and "bar" is another config var, and bar
is set using config_proxy.parse_argv().

because before 773ef117, apply_changes() calls update_legacy_vals(),
which expand meta vars for legacy config vals, but after 773ef117,
we cannot change config_values in apply_changes() anymore. so
update_legacy_vals() calls is moved to apply_changes()'s callers
accordingly. but the apply_changes() is also called by global_init()
directly instead of by the routines in config.cc. so in 773ef117,
i missed it.

in this change, it's put back into parse_argv() instead of into
global_init(), as update_legacy_vals() is a low level function, and
parse_argv() could change the config_values, it's better to call
update_legacy_vals() out there, just like set_mon_vals() and
parse_config_files().

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/common/config.cc