def test_fill_defaults(self): orig = {'key1': 'val1', 'key3': 'val3'} defaults = {'key1': 'default1', 'key2': 'default2'} filled = orig.copy() config.fill_defaults(filled, defaults) self.assertEqual(filled, {'key1': 'val1', 'key2': 'default2', 'key3': 'val3'})
def get_conf(): conf = _get_conf() for name in REQUIRED_FILES: if name not in conf: _LOGGER.debug("Workers configuration for %s not found. " "Default configuration will be deployed", name) defaults = build_defaults() config.fill_defaults(conf, defaults) validate(conf) return conf
def get_conf(): conf = _get_conf() for name in REQUIRED_FILES: if name not in conf: _LOGGER.debug('Workers configuration for %s not found. ' 'Default configuration will be deployed', name) defaults = build_defaults() config.fill_defaults(conf, defaults) validate(conf) return conf
def read_conf(self): conf = self._get_conf_from_file() config.fill_defaults(conf, DEFAULT_PROPERTIES) validate(conf) return conf
def get_conf(): conf = _get_conf_from_file() validate(conf) config.fill_defaults(conf, DEFAULT_PROPERTIES) return conf