renamed dict variable in ConfigurationManager

This commit is contained in:
Blake J. Harnden 2018-06-13 12:39:50 -07:00
parent 7dbc2c40f8
commit a52e454111
2 changed files with 9 additions and 9 deletions

View file

@ -125,7 +125,7 @@ class ConfigurableManager(object):
""" """
Creates a ConfigurableManager object. Creates a ConfigurableManager object.
""" """
self._configuration_maps = {} self.node_configurations = {}
def nodes(self): def nodes(self):
""" """
@ -134,7 +134,7 @@ class ConfigurableManager(object):
:return: list of node ids :return: list of node ids
:rtype: list :rtype: list
""" """
return [node_id for node_id in self._configuration_maps.iterkeys() if node_id != self._default_node] return [node_id for node_id in self.node_configurations.iterkeys() if node_id != self._default_node]
def has_configs(self, node_id): def has_configs(self, node_id):
""" """
@ -144,7 +144,7 @@ class ConfigurableManager(object):
:return: True if a node configuration exists, False otherwise :return: True if a node configuration exists, False otherwise
:rtype: bool :rtype: bool
""" """
return node_id in self._configuration_maps return node_id in self.node_configurations
def config_reset(self, node_id=None): def config_reset(self, node_id=None):
""" """
@ -155,9 +155,9 @@ class ConfigurableManager(object):
""" """
logger.debug("resetting all configurations: %s", self.__class__.__name__) logger.debug("resetting all configurations: %s", self.__class__.__name__)
if not node_id: if not node_id:
self._configuration_maps.clear() self.node_configurations.clear()
elif node_id in self._configuration_maps: elif node_id in self.node_configurations:
self._configuration_maps.pop(node_id) self.node_configurations.pop(node_id)
def set_config(self, _id, value, node_id=_default_node, config_type=_default_type): def set_config(self, _id, value, node_id=_default_node, config_type=_default_type):
""" """
@ -225,7 +225,7 @@ class ConfigurableManager(object):
:rtype: dict :rtype: dict
""" """
logger.debug("getting all configs for node(%s)", node_id) logger.debug("getting all configs for node(%s)", node_id)
return self._configuration_maps.setdefault(node_id, OrderedDict()) return self.node_configurations.setdefault(node_id, OrderedDict())
class ConfigurableOptions(object): class ConfigurableOptions(object):

View file

@ -68,7 +68,7 @@ class TestConf:
config_manager.config_reset() config_manager.config_reset()
# then # then
assert not config_manager._configuration_maps assert not config_manager.node_configurations
def test_config_reset_node(self): def test_config_reset_node(self):
# given # given
@ -82,7 +82,7 @@ class TestConf:
config_manager.config_reset(node_id) config_manager.config_reset(node_id)
# then # then
assert node_id not in config_manager._configuration_maps assert not config_manager.has_configs(node_id)
assert config_manager.get_configs() assert config_manager.get_configs()
def test_configs_setget(self): def test_configs_setget(self):