From 157cfd3a33fec5791a969aeb3c3face9db4e8905 Mon Sep 17 00:00:00 2001 From: Szymon Datko Date: Mon, 21 Mar 2022 13:39:05 +0100 Subject: [PATCH] Catch AttributeError from node It turns out that json.loads accept strings with numerical values, such as '3.11', and raises no exception. Then there is a problem in function where we treat the value as dictionary with doing .get(), which results in AttributeError. This commit catches that. --- devnest/lib/node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devnest/lib/node.py b/devnest/lib/node.py index 20d06b0..dde9a9a 100755 --- a/devnest/lib/node.py +++ b/devnest/lib/node.py @@ -670,7 +670,7 @@ def _get_reservation_info(self): owner, reprovision_pending) - except (TypeError, ValueError): + except (AttributeError, TypeError, ValueError): LOG.debug('Could not read reservation data for node %s,' ' invalid json format: %s' % (self.get_name(), offline_cause_reason))