diff --git a/hier_config/__init__.py b/hier_config/__init__.py index a7f1d91..e05e510 100644 --- a/hier_config/__init__.py +++ b/hier_config/__init__.py @@ -2,7 +2,7 @@ import re -__version__ = '1.2.1' +__version__ = '1.2.2' class HConfig(HConfigChild): diff --git a/hier_config/hc_child.py b/hier_config/hc_child.py index 4f384ff..a765cea 100644 --- a/hier_config/hc_child.py +++ b/hier_config/hc_child.py @@ -575,7 +575,7 @@ def _config_to_get_to_left(self, target, delta): deleted.negate() if self_child.children: deleted.comments.add( - "removes {} lines".format(len(self_child.children_dict + 1))) + "removes {} lines".format(len(self_child.children_dict) + 1)) def _config_to_get_to_right(self, target, delta): # find what would need to be added to source_config to get to self diff --git a/tests/test_hier_config.py b/tests/test_hier_config.py index d278f50..70dc72a 100644 --- a/tests/test_hier_config.py +++ b/tests/test_hier_config.py @@ -290,7 +290,8 @@ def test_negate(self): def test_config_to_get_to(self): running_config_hier = HConfig(self.host_a, self.os, self.options) - running_config_hier.add_child('interface Vlan2') + interface = running_config_hier.add_child('interface Vlan2') + interface.add_child('ip address 192.168.1.1/24') compiled_config_hier = HConfig(self.host_a, self.os, self.options) compiled_config_hier.add_child('interface Vlan3') remediation_config_hier = running_config_hier.config_to_get_to(