Skip to content

Commit 2487dc9

Browse files
authored
Honor option to instantiate optional children (#1088)
Previously, the flag in which the user specified whether or not to instantiate optional children was only honored on the top-level object (i.e., first recursion round) Fixes #1087
1 parent 3721b1a commit 2487dc9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

opcua/common/instantiate.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,17 @@ def _instantiate_node(server,
113113
res.AddedNodeId,
114114
c_rdesc,
115115
nodeid=ua.NodeId(identifier=inst_nodeid, namespaceidx=res.AddedNodeId.NamespaceIndex),
116-
bname=c_rdesc.BrowseName)
116+
bname=c_rdesc.BrowseName,
117+
instantiate_optional=instantiate_optional)
117118
else:
118119
nodeids = _instantiate_node(
119120
server,
120121
c_node_type,
121122
res.AddedNodeId,
122123
c_rdesc,
123124
nodeid=ua.NodeId(namespaceidx=res.AddedNodeId.NamespaceIndex),
124-
bname=c_rdesc.BrowseName)
125+
bname=c_rdesc.BrowseName,
126+
instantiate_optional=instantiate_optional)
125127
added_nodes.extend(nodeids)
126128

127129
return added_nodes

0 commit comments

Comments
 (0)