Example #1
0
 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'})
Example #2
0
 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'})
Example #3
0
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
Example #4
0
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
Example #5
0
 def read_conf(self):
     conf = self._get_conf_from_file()
     config.fill_defaults(conf, DEFAULT_PROPERTIES)
     validate(conf)
     return conf
Example #6
0
 def read_conf(self):
     conf = self._get_conf_from_file()
     config.fill_defaults(conf, DEFAULT_PROPERTIES)
     validate(conf)
     return conf
Example #7
0
def get_conf():
    conf = _get_conf_from_file()
    validate(conf)
    config.fill_defaults(conf, DEFAULT_PROPERTIES)
    return conf
Example #8
0
def get_conf():
    conf = _get_conf_from_file()
    validate(conf)
    config.fill_defaults(conf, DEFAULT_PROPERTIES)
    return conf