From 305c0910f08c8b6772be0247cfc03fa0282478c8 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 15 Jul 2020 15:04:21 -0500 Subject: xml: T2588: defaults should return gracefully on key error --- python/vyos/xml/definition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/vyos/xml/definition.py b/python/vyos/xml/definition.py index 5421007e0..b0339b228 100644 --- a/python/vyos/xml/definition.py +++ b/python/vyos/xml/definition.py @@ -248,7 +248,7 @@ class XML(dict): def defaults(self, lpath, flat): d = self[kw.default] for k in lpath: - d = d[k] + d = d.get(k, {}) if not flat: r = {} -- cgit v1.2.3