Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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"
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")
)
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)
def get_config():
return ConfigManager(
[
ConfigIniEnv([
os.environ.get('CIS_CONFIG_INI'),
'~/.mozilla-cis.ini',
'/etc/mozilla-cis.ini'
]),
ConfigOSEnv()
]
def get_config():
return ConfigManager(
[ConfigIniEnv([os.environ.get("CIS_CONFIG_INI"), "~/.mozilla-cis.ini", "/etc/mozilla-cis.ini"]), ConfigOSEnv()]
)
def get_config():
return ConfigManager(
[
ConfigIniEnv([
os.environ.get('THREATRESPONSE_INI'),
'~/.threatresponse.ini',
'/etc/threatresponse.ini'
]),
ConfigOSEnv()
]
def get_config():
return ConfigManager(
[
ConfigOSEnv()
]