summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2022-02-25 16:12:29 -0600
committerJohn Estabrook <jestabro@vyos.io>2022-02-28 13:42:24 -0600
commit4625fd41f99ddf77c104a657cd90a1ddf5449dd8 (patch)
tree1191d47fdafc2a75f1a235744a19ea416c35d942
parent3d28528ff84b4e874faf80028709bd08b2956933 (diff)
downloadvyos-1x-4625fd41f99ddf77c104a657cd90a1ddf5449dd8.tar.gz
vyos-1x-4625fd41f99ddf77c104a657cd90a1ddf5449dd8.zip
configtree: T4235: allow empty arguments
-rw-r--r--python/vyos/configtree.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/vyos/configtree.py b/python/vyos/configtree.py
index f5e697137..5ba829a4c 100644
--- a/python/vyos/configtree.py
+++ b/python/vyos/configtree.py
@@ -305,6 +305,10 @@ class ConfigTree(object):
class DiffTree:
def __init__(self, left, right, path=[], libpath=LIBPATH):
+ if left is None:
+ left = ConfigTree(config_string='\n')
+ if right is None:
+ right = ConfigTree(config_string='\n')
if not (isinstance(left, ConfigTree) and isinstance(right, ConfigTree)):
raise TypeError("Arguments must be instances of ConfigTree")
if path: