##// END OF EJS Templates
service: expose config so enterprise can read it.
marcink -
r784:442d1efe default
parent child Browse files
Show More
@@ -468,23 +468,31 b' class HTTPApplication(object):'
468 import vcsserver
468 import vcsserver
469
469
470 payload = msgpack.unpackb(request.body, use_list=True)
470 payload = msgpack.unpackb(request.body, use_list=True)
471 server_config, app_config = {}, {}
471
472
472 try:
473 try:
473 path = self.global_config['__file__']
474 path = self.global_config['__file__']
474 config = configparser.ConfigParser()
475 config = configparser.RawConfigParser()
476
475 config.read(path)
477 config.read(path)
476 parsed_ini = config
478
477 if parsed_ini.has_section('server:main'):
479 if config.has_section('server:main'):
478 parsed_ini = dict(parsed_ini.items('server:main'))
480 server_config = dict(config.items('server:main'))
481 if config.has_section('app:main'):
482 app_config = dict(config.items('app:main'))
483
479 except Exception:
484 except Exception:
480 log.exception('Failed to read .ini file for display')
485 log.exception('Failed to read .ini file for display')
481 parsed_ini = {}
486
487 environ = os.environ.items()
482
488
483 resp = {
489 resp = {
484 'id': payload.get('id'),
490 'id': payload.get('id'),
485 'result': dict(
491 'result': dict(
486 version=vcsserver.__version__,
492 version=vcsserver.__version__,
487 config=parsed_ini,
493 config=server_config,
494 app_config=app_config,
495 environ=environ,
488 payload=payload,
496 payload=payload,
489 )
497 )
490 }
498 }
General Comments 0
You need to be logged in to leave comments. Login now