Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Delete a Node with Custom Type #1757

Open
Study-boy-dot opened this issue Dec 5, 2024 · 0 comments
Open

How to Delete a Node with Custom Type #1757

Study-boy-dot opened this issue Dec 5, 2024 · 0 comments

Comments

@Study-boy-dot
Copy link

Description:
I am trying to delete a node with a custom type using the asyncua framework. I have reviewed the client-deleting.py example provided in the repository and attempted to implement node deletion in my application. However, I am encountering an issue: after calling delete_nodes, I am still able to access and read the node's attributes like BrowseName.
Code Example:

# Attempt to delete a batch of nodes
await self.client.delete_nodes(self.obj_list)

# Attempt to delete a single node
node = self.client.get_node(self.obj_nodeid)
results = await self.client.delete_nodes([node])  # Delete one node

# Verify if the node still exists
node_after = self.client.get_node(self.obj_nodeid)
try:
    browse_name = await node_after.read_browse_name()
except Exception:
    logger.info("Delete Successfully")

Observed Behavior:
Even after calling delete_nodes, the node remains accessible. I am still able to retrieve the BrowseName using read_browse_name() without any exceptions.

Expected Behavior:
After calling delete_nodes, the node should no longer exist, and attempting to access it should raise an exception.

Additional Context:
The node being deleted has a custom type derived from BaseObjectType.
asyncua version: 1.1.5
python version: 3.8.17
I have stored the nodes in a list and attempted both batch deletion and single-node deletion.
Is there something I am missing in the deletion process? Any guidance or example code would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant