From 430110656a17b176908286a3349ca489c4f7b369 Mon Sep 17 00:00:00 2001 From: Romain Broucquart <romain.broucquart@synchrotron-soleil.fr> Date: Fri, 25 Sep 2020 16:51:16 +0200 Subject: [PATCH] [AppChecker] Fixes after first test --- AppChecker.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/AppChecker.py b/AppChecker.py index 52568a1..e393b51 100644 --- a/AppChecker.py +++ b/AppChecker.py @@ -138,21 +138,22 @@ class AppChecker: # Check write attributes wattr = context[devicepath]["wattributes"] failattr = dict() - for attr in wattr.keys(): - value = prox[attr].value - if value != wattr[attr] + rattr = prox.read_attributes(list(wattr.keys())) + for attr in rattr: + value = attr.value + if value != wattr[attr.name]: self.logger.warning("Attribute %s/%s value mismatch. Read %s, expect %s."%( devicepath, - attr, + attr.name, value, - wattr[attr]) + wattr[attr.name])) status=False - failattr[attr]=value + failattr[attr.name]=value else: self.logger.info("Attribute %s/%s is correctly set to value %s."%( devicepath, - attr, - value) + attr.name, + value)) # ----------------------------------------------------- # Check properties @@ -167,20 +168,20 @@ class AppChecker: k, devicepath, value, - props[k]) + props[k])) status=False failprop[k]=value else: self.logger.info("Property %s of device %s is correctly set to %s"%( k, devicepath, - value) + value)) # ----------------------------------------------------- # Append to faild context if any fail if len(failattr.keys()) + len(failprop.keys())>0: failcontext[devicepath]= { - "properties":failprops, + "properties":failprop, "wattributes":failattr, } -- GitLab