How to use the everett.manager.ConfigOSEnv 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 / test_manager.py View on Github external
def test_ConfigOSEnv():
    os.environ["EVERETT_TEST_FOO"] = "bar"
    os.environ["EVERETT_TEST_FOO"] = "bar"
    cose = ConfigOSEnv()

    assert cose.get("everett_test_foo") == "bar"
    assert cose.get("EVERETT_test_foo") == "bar"
    assert cose.get("foo", namespace=["everett", "test"]) == "bar"
github ansible-community / ara / ara / server / utils.py View on Github external
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

        self.ENVIRON = EnvironProxy(
            ConfigManager(
                [
                    ConfigOSEnv(),
                    ConfigEnvFileEnv(".env"),
                    DumbConfigIniEnv([os.environ.get("ARA_CFG"), "~/.config/ara/server.cfg", "/etc/ara/server.cfg"]),
                ]
            ).with_namespace("ara")
        )
github azavea / raster-vision / rastervision / rv_config.py View on Github external
home = os.path.expanduser('~')
            rv_home = os.path.join(home, '.rastervision')
        self.rv_home = rv_home

        config_file_locations = self._discover_config_file_locations(profile)

        help_doc = ('Check https://docs.rastervision.io/ for docs.')
        self.config = ConfigManager(
            # Specify one or more configuration environments in
            # the order they should be checked
            [
                # Allow overrides
                ConfigDictEnv(config_overrides),

                # Looks in OS environment first
                ConfigOSEnv(),

                # Look for an .env file
                ConfigEnvFileEnv('.env'),

                # Looks in INI files in order specified
                ConfigIniEnv(config_file_locations),
            ],

            # Make it easy for users to find your configuration docs
            doc=help_doc)
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-iam / cis / python-modules / cis_profile_retrieval_service / cis_profile_retrieval_service / 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 mozilla-iam / cis / cis / settings.py View on Github external
def get_config():
    return ConfigManager(
        [
            ConfigOSEnv()
        ]