Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:58:22

0001 #!/usr/bin/env python
0002 #
0003 # Licensed under the Apache License, Version 2.0 (the "License");
0004 # You may not use this file except in compliance with the License.
0005 # You may obtain a copy of the License at
0006 # http://www.apache.org/licenses/LICENSE-2.0OA
0007 #
0008 # Authors:
0009 # - Wen Guan, <wen.guan@cern.ch>, 2022
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)