Files
galaxy/scripts/build_universe_config.py
T
John Chilton c3e99bc384 Improvements to reports management script (run_reports.sh) to enable managing the reports app from CloudMan. These enhancements are all "optional", the default behavior of run_reports.sh is unchanged.
Added flag (--sync-config) to run_reports.sh script that will cause it to synchronize the database connection and file path properties in reports_wsgi.ini with those in universe_wsgi.ini prior to starting paster app.

Allow specification of reports configuration directory mirroring similar extensions previously accepted for universe config and run.sh

Added usage documentation to run_reports.sh.

Added extension points to tweak pid and log location for reports application via environment variables.
2012-09-21 22:04:15 -05:00

31 lines
890 B
Python

from ConfigParser import ConfigParser
from os import listdir
from os.path import join
from re import match
from sys import argv
def merge():
"Merges all .ini files in a specified directory into ./universe.ini"
if len(argv) < 2:
message = "%s: Must specify directory to merge configuration files from." % argv[0]
raise Exception(message)
conf_directory = argv[1]
conf_files = [f for f in listdir(conf_directory) if match(r'.*\.ini', f)]
conf_files.sort()
parser = ConfigParser()
for conf_file in conf_files:
parser.read([join(conf_directory, conf_file)])
## TODO: Expand enviroment variables here, that would
## also make Galaxy much easier to configure.
destination= "universe_wsgi.ini"
if len(argv) > 2:
destination = argv[2]
parser.write(open(destination, 'w'))
if __name__ == '__main__':
merge()