pkg/config/legacy/tests/config.py
def extract_sd_config(config):
    """Extract configuration about service discovery for the agent"""
    sd_config = {}
    if config.has_option('Main', 'sd_config_backend'):
        sd_config['sd_config_backend'] = config.get('Main', 'sd_config_backend')
    else:
        sd_config['sd_config_backend'] = None
    if config.has_option('Main', 'sd_template_dir'):
        sd_config['sd_template_dir'] = config.get('Main', 'sd_template_dir')
    else:
        sd_config['sd_template_dir'] = SD_TEMPLATE_DIR
    if config.has_option('Main', 'sd_backend_host'):
        sd_config['sd_backend_host'] = config.get('Main', 'sd_backend_host')
    if config.has_option('Main', 'sd_backend_port'):
        sd_config['sd_backend_port'] = config.get('Main', 'sd_backend_port')
    if config.has_option('Main', 'sd_jmx_enable'):
        sd_config['sd_jmx_enable'] = config.get('Main', 'sd_jmx_enable')
    return sd_config
Extract configuration about service discovery for the agent
Extract configuration about service discovery for the agent
Extract configuration about service discovery for the agent
def extract_sd_config(config):
    sd_config = {}
    if config.has_option('Main', 'sd_config_backend'):
        sd_config['sd_config_backend'] = config.get('Main', 'sd_config_backend')
    else:
        sd_config['sd_config_backend'] = None
    if config.has_option('Main', 'sd_template_dir'):
        sd_config['sd_template_dir'] = config.get('Main', 'sd_template_dir')
    else:
        sd_config['sd_template_dir'] = SD_TEMPLATE_DIR
    if config.has_option('Main', 'sd_backend_host'):
        sd_config['sd_backend_host'] = config.get('Main', 'sd_backend_host')
    if config.has_option('Main', 'sd_backend_port'):
        sd_config['sd_backend_port'] = config.get('Main', 'sd_backend_port')
    if config.has_option('Main', 'sd_jmx_enable'):
        sd_config['sd_jmx_enable'] = config.get('Main', 'sd_jmx_enable')
    return sd_config
def extract_sd_config ( config ) : sd_config = { } if config . has_option ( 'Main' , 'sd_config_backend' ) : sd_config [ 'sd_config_backend' ] = config . get ( 'Main' , 'sd_config_backend' ) else : sd_config [ 'sd_config_backend' ] = None if config . has_option ( 'Main' , 'sd_template_dir' ) : sd_config [ 'sd_template_dir' ] = config . get ( 'Main' , 'sd_template_dir' ) else : sd_config [ 'sd_template_dir' ] = SD_TEMPLATE_DIR if config . has_option ( 'Main' , 'sd_backend_host' ) : sd_config [ 'sd_backend_host' ] = config . get ( 'Main' , 'sd_backend_host' ) if config . has_option ( 'Main' , 'sd_backend_port' ) : sd_config [ 'sd_backend_port' ] = config . get ( 'Main' , 'sd_backend_port' ) if config . has_option ( 'Main' , 'sd_jmx_enable' ) : sd_config [ 'sd_jmx_enable' ] = config . get ( 'Main' , 'sd_jmx_enable' ) return sd_config
Extract configuration about service discovery for the agent
Extract configuration about service discovery for the agent
"""Extract configuration about service discovery for the agent"""
config