Skip to content

Commit 94d0798

Browse files
committed
consolidate st2.conf.sample generation in one place
1 parent d0937f9 commit 94d0798

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

Makefile

+1-4
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,7 @@ configgen: requirements .configgen
317317
@echo
318318
@echo "================== config gen ===================="
319319
@echo
320-
echo "# Sample config which contains all the available options which the corresponding descriptions" > conf/st2.conf.sample;
321-
echo "# Note: This file is automatically generated using tools/config_gen.py - DO NOT UPDATE MANUALLY" >> conf/st2.conf.sample
322-
echo "" >> conf/st2.conf.sample
323-
. $(VIRTUALENV_DIR)/bin/activate; python ./tools/config_gen.py >> conf/st2.conf.sample;
320+
. $(VIRTUALENV_DIR)/bin/activate; python ./tools/config_gen.py > conf/st2.conf.sample;
324321

325322
.PHONY: schemasgen
326323
schemasgen: requirements .schemasgen

tools/config_gen.py

+7
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@
7777
"webui": {"webui_base_url": "https://localhost"},
7878
}
7979

80+
INIT_COMMENT = """
81+
# Sample config which contains all the available options which the corresponding descriptions
82+
# Note: This file is automatically generated using tools/config_gen.py - DO NOT UPDATE MANUALLY
83+
""".strip()
84+
8085
COMMON_AUTH_OPTIONS_COMMENT = """
8186
# Common option - options below apply in both scenarios - when auth service is running as a WSGI
8287
# service (e.g. under Apache or Nginx) and when it's running in the standalone mode.
@@ -186,6 +191,8 @@ def _print_options(opt_group, options):
186191

187192

188193
def main(args):
194+
print(INIT_COMMENT)
195+
print("")
189196
opt_groups = {}
190197
for config in CONFIGS:
191198
mod = _import_config(config)

0 commit comments

Comments
 (0)