Skip to content

Commit

Permalink
consolidate st2.conf.sample generation in one place
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Aug 19, 2022
1 parent d0937f9 commit 94d0798
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,7 @@ configgen: requirements .configgen
@echo
@echo "================== config gen ===================="
@echo
echo "# Sample config which contains all the available options which the corresponding descriptions" > conf/st2.conf.sample;
echo "# Note: This file is automatically generated using tools/config_gen.py - DO NOT UPDATE MANUALLY" >> conf/st2.conf.sample
echo "" >> conf/st2.conf.sample
. $(VIRTUALENV_DIR)/bin/activate; python ./tools/config_gen.py >> conf/st2.conf.sample;
. $(VIRTUALENV_DIR)/bin/activate; python ./tools/config_gen.py > conf/st2.conf.sample;

.PHONY: schemasgen
schemasgen: requirements .schemasgen
Expand Down
7 changes: 7 additions & 0 deletions tools/config_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
"webui": {"webui_base_url": "https://localhost"},
}

INIT_COMMENT = """
# Sample config which contains all the available options which the corresponding descriptions
# Note: This file is automatically generated using tools/config_gen.py - DO NOT UPDATE MANUALLY
""".strip()

COMMON_AUTH_OPTIONS_COMMENT = """
# Common option - options below apply in both scenarios - when auth service is running as a WSGI
# service (e.g. under Apache or Nginx) and when it's running in the standalone mode.
Expand Down Expand Up @@ -186,6 +191,8 @@ def _print_options(opt_group, options):


def main(args):
print(INIT_COMMENT)
print("")
opt_groups = {}
for config in CONFIGS:
mod = _import_config(config)
Expand Down

0 comments on commit 94d0798

Please sign in to comment.