check for interfaces
@@ -55,8 +55,10 @@ class Parser:
if obj_doc:
# TODO make this smarter about more complex configurations (backup original values, etc)
obj_copy = deepcopy(obj_doc)
+ if 'dps' in obj_copy:
for switch in obj_copy['dps']:
- for port in obj_copy['dps'][switch]:
+ if 'interfaces' in obj_copy['dps'][switch]:
+ for port in obj_copy['dps'][switch]['interfaces']:
if 'mirror' in obj_copy['dps'][switch]['interfaces'][port]:
del obj_doc['dps'][switch]['interfaces'][port]['mirror']
if 'timeout' in obj_copy['dps'][switch]:
