GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
If you do an uninstall on the ZenPack it leaves components on the device. If you click on a component a ribbon error is displayed. The template also remains on the system.
Thanks for the report. I can easily replicate this. This kind of thing isn't a problem in most ZenPacks because they deliver their own device class which gets completely removed including any included devices if you remove the ZenPack. Because the RabbitMQ ZenPack just adds modeler plugins and monitoring templates to existing device classes, it doesn't benefit from the automatic cleanup.
Explicit cleanup needs to be added to the ZenPack's remove method.
Would inheriting ZenPackPersistence on the component classes work here at all? Wouldn't that clean up the components on uninstall?
I wasn't sure on the answer to that so I made inherited from ZenPackPersistence in RabbitMQComponent and implemented the contract. A quick test seems to indicate that it doesn't work. I haven't dug into why yet.
I looked around at some other analogous ZenPacks. Looks like the community RDBMS ZenPack removes all components properly when being uninstalled. Its remove() in init.py isn't very different than what is in the RabbtiMQ ZenPack - except that the components there are a relation to OperatingSystem, rather than Device.