How to use the configparser.ConfigParser.SafeConfigParser function in configparser

To help you get started, we’ve selected a few configparser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / efs-utils / test / mount_efs_test / test_is_ocsp_enabled.py View on Github external
def _get_config(stunnel_check_cert_validity):
    try:
        config = ConfigParser.SafeConfigParser()
    except AttributeError:
        config = ConfigParser()
    config.add_section(mount_efs.CONFIG_SECTION)
    if stunnel_check_cert_validity is not None:
        config.set(mount_efs.CONFIG_SECTION, 'stunnel_check_cert_validity', str(stunnel_check_cert_validity))
    return config
github aws / efs-utils / test / mount_efs_test / test_add_stunnel_ca_options.py View on Github external
def _get_config():
    try:
        config = ConfigParser.SafeConfigParser()
    except AttributeError:
        config = ConfigParser()
    config.add_section(mount_efs.CONFIG_SECTION)
    return config
github aws / efs-utils / test / mount_efs_test / test_create_state_file_dir.py View on Github external
def _get_config(mode=None):
    try:
        config = ConfigParser.SafeConfigParser()
    except AttributeError:
        config = ConfigParser()
    config.add_section(mount_efs.CONFIG_SECTION)

    if mode is not None:
        config.set(mount_efs.CONFIG_SECTION, 'state_file_dir_mode', mode)

    return config
github aws / efs-utils / test / watchdog_test / test_check_efs_mounts.py View on Github external
def _get_config():
    try:
        config = ConfigParser.SafeConfigParser()
    except AttributeError:
        config = ConfigParser()
    config.add_section(mount_efs.CONFIG_SECTION)
    config.set(mount_efs.CONFIG_SECTION, 'state_file_dir_mode', '750')
    return config
github aws / efs-utils / src / watchdog / __init__.py View on Github external
def read_config(config_file=CONFIG_FILE):
    try:
        p = ConfigParser.SafeConfigParser()
    except AttributeError:
        p = ConfigParser()
    p.read(config_file)
    return p
github aws / efs-utils / src / mount_efs / __init__.py View on Github external
def read_config(config_file=CONFIG_FILE):
    try:
        p = ConfigParser.SafeConfigParser()
    except AttributeError:
        p = ConfigParser()
    p.read(config_file)
    return p