summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2022-02-25 16:12:29 -0600
committerJohn Estabrook <jestabro@vyos.io>2022-04-20 18:23:16 -0500
commit5b1231a0511095aa1b82a8c7bb1e119e3576e228 (patch)
tree80516511892c280acbe996a7b935f8c7c6f0a263
parent4102ff9c7ca96f6056864a9560e3634fb3d8e34d (diff)
downloadvyos-1x-5b1231a0511095aa1b82a8c7bb1e119e3576e228.tar.gz
vyos-1x-5b1231a0511095aa1b82a8c7bb1e119e3576e228.zip
configtree: T4235: allow empty arguments
(cherry picked from commit 4625fd41f99ddf77c104a657cd90a1ddf5449dd8)
-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: