]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: the metavariables in frontends-related config won't be expanded
authorroot <root@TENCENT64.site>
Tue, 26 Dec 2017 10:11:47 +0000 (18:11 +0800)
committerroot <root@TENCENT64.site>
Tue, 26 Dec 2017 12:14:40 +0000 (20:14 +0800)
When using metavariables in frontends-related config, I found that metavariables won't be expanded. Such as:
the `name` variable won't be expanded.
```
[client.rgw]
rgw frontends = civetweb port=8000 access_log_file=/path/$name.access.log
```
The reason is as follows:

In `rgw_main.cc/main()` function, program uses frontends-related config before the `expand_all_meta` function call that is called in the `global_init` function.

Signed-off-by: chnmagnus chnmagnus@qq.com
src/rgw/rgw_main.cc

index d3688e9804a6f2727b567c72752a007d35ffbbe5..aaa57ae0ef314fb07463fe3cf90989d57a129a7a 100644 (file)
@@ -197,6 +197,7 @@ int main(int argc, const char **argv)
           flags);
 
   list<string> frontends;
+  g_conf->early_expand_meta(g_conf->rgw_frontends, &cerr);
   get_str_list(g_conf->rgw_frontends, ",", frontends);
   multimap<string, RGWFrontendConfig *> fe_map;
   list<RGWFrontendConfig *> configs;