File indexing completed on 2026-04-09 07:58:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 import argparse
0013 import logging
0014
0015
0016 def config_api_host(conf_file_template="data/conf.js.template", conf_file='data/conf.js', hostname=None):
0017 with open(conf_file_template, 'r') as f:
0018 template = f.read()
0019 template = template.format(api_host_name=hostname)
0020 with open(conf_file, 'w') as f:
0021 f.write(template)
0022
0023
0024 logging.getLogger().setLevel(logging.INFO)
0025 parser = argparse.ArgumentParser(description="config iDDS monitor")
0026 parser.add_argument('-s', '--source', default=None, help='Source config file path')
0027 parser.add_argument('-d', '--destination', default=None, help='Destination file path')
0028 parser.add_argument('--host', default=None, help='idds host name')
0029 args = parser.parse_args()
0030
0031
0032 config_api_host(conf_file_template=args.source, conf_file=args.destination, hostname=args.host)