How to use the everett.ext.inifile.ConfigIniEnv function in everett

To help you get started, we’ve selected a few everett 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 willkg / everett / tests / ext / test_inifile.py View on Github external
def test_does_not_parse_lists(self, datadir):
        ini_filename = os.path.join(datadir, "config_test.ini")
        cie = ConfigIniEnv([ini_filename])
        assert cie.get("bar") == "test1,test2"
github willkg / everett / tests / ext / test_inifile.py View on Github external
def test_multiple_files(self, datadir):
        ini_filename = os.path.join(datadir, "config_test.ini")
        ini_filename_original = os.path.join(datadir, "config_test_original.ini")
        cie = ConfigIniEnv([ini_filename, ini_filename_original])
        # Only the first found file is loaded, so foo_original does not exist
        assert cie.get("foo_original") == NO_VALUE
        cie = ConfigIniEnv([ini_filename_original])
        # ... but it is there if only the original is loaded (safety check)
        assert cie.get("foo_original") == "original"
github mozilla-iam / cis / python-modules / cis_crypto / cis_crypto / common.py View on Github external
def get_config():
    return ConfigManager(
        [ConfigIniEnv([os.environ.get("CIS_CONFIG_INI"), "~/.mozilla-cis.ini", "/etc/mozilla-cis.ini"]), ConfigOSEnv()]
    )
github mozilla-iam / cis / python-modules / cis_profile / cis_profile / common.py View on Github external
def get_config():
    return ConfigManager(
        [ConfigIniEnv([os.environ.get("CIS_CONFIG_INI"), "~/.mozilla-cis.ini", "/etc/mozilla-cis.ini"]), ConfigOSEnv()]
    )
github mozilla-iam / cis / python-modules / cis_fake_well_known / cis_fake_well_known / common.py View on Github external
def get_config():
    return ConfigManager(
        [
            ConfigIniEnv([
                os.environ.get('CIS_CONFIG_INI'),
                '~/.mozilla-cis.ini',
                '/etc/mozilla-cis.ini'
            ]),
            ConfigOSEnv()
        ]
github mozilla / ssm-acquire / ssm_acquire / common.py View on Github external
def get_config():
    return ConfigManager(
        [
            ConfigIniEnv([
                os.environ.get('THREATRESPONSE_INI'),
                '~/.threatresponse.ini',
                '/etc/threatresponse.ini'
            ]),
            ConfigOSEnv()
        ]
github willkg / everett / docs / code / configuration_sources.py View on Github external
import os
from everett.ext.inifile import ConfigIniEnv
from everett.manager import (
    ConfigDictEnv,
    ConfigManager,
    ConfigOSEnv
)

config = ConfigManager([
    # Pull from the OS environment first
    ConfigOSEnv(),

    # Fall back to the file specified by the FOO_INI OS environment
    # variable if such file exists
    ConfigIniEnv(os.environ.get('FOO_INI')),

    # Fall back to this dict of defaults
    ConfigDictEnv({
        'FOO_VAR': 'bar'
    })
])

assert config('foo_var') == 'bar'
github mozilla-iam / cis / python-modules / cis_processor / cis_processor / common.py View on Github external
def get_config():
    return ConfigManager(
        [ConfigIniEnv([os.environ.get("CIS_CONFIG_INI"), "~/.mozilla-cis.ini", "/etc/mozilla-cis.ini"]), ConfigOSEnv()]
    )