Skip to content

Commit aed7ab0

Browse files
lovasoaoroulet
authored andcommitted
Write to the logs on invalid attribute read/write
1 parent 3f758d8 commit aed7ab0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

opcua/server/address_space.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ def get_attribute_value(self, nodeid, attr):
650650
return dv
651651
node = self._nodes[nodeid]
652652
if attr not in node.attributes:
653+
self.logger.warning("Tried to read attribute '%s' in %s, but the attribute is missing", attr, nodeid)
653654
dv = ua.DataValue()
654655
dv.StatusCode = ua.StatusCode(ua.StatusCodes.BadAttributeIdInvalid)
655656
return dv
@@ -666,6 +667,7 @@ def set_attribute_value(self, nodeid, attr, value):
666667
return ua.StatusCode(ua.StatusCodes.BadNodeIdUnknown)
667668
attval = node.attributes.get(attr, None)
668669
if attval is None:
670+
self.logger.warning("Tried to write attribute '%s' in %s, but the attribute is missing", attr, nodeid)
669671
return ua.StatusCode(ua.StatusCodes.BadAttributeIdInvalid)
670672

671673
old = attval.value

0 commit comments

Comments
 (0)