bugfix in netcfg to handle multilevel commands

this fixes a bug where netcfg would not properly find a statement that was
more than one level deep
This commit is contained in:
Peter Sprygada 2016-04-04 08:10:22 -04:00
parent d358a22542
commit 4e497b10b0

View file

@ -174,7 +174,8 @@ class NetworkConfig(object):
def get_object(self, path): def get_object(self, path):
for item in self.items: for item in self.items:
if item.text == path[-1]: if item.text == path[-1]:
if item.parents == path[:-1]: parents = [p.text for p in item.parents]
if parents == path[:-1]:
return item return item
def get_children(self, path): def get_children(self, path):