zenoss / ZenPacks.zenoss.ZenPackLib

This is a helper library for zenpacks.
http://zenpacklib.zenoss.com/
GNU General Public License v2.0
15 stars 17 forks source link

Fix for not creating device classes in some cases #435

Closed cluther closed 7 years ago

cluther commented 7 years ago

The current develop branch of the Windows ZenPack is experiencing a problem with ZenPack where the /Server/Microsoft/Windows device class doesn't get installed when the ZenPack is installed.

This issue seems to have been brought to light by the fix for ZEN-925 in ZenPackLib 2.0.3. Specifically 07cf5e5.

Acquisition strikes again. When the following device classes exist..

The following code will return the /Server/Windows device class.

dmd.Devices.getOrganizer("Server/Microsoft/Windows")

Obviously this isn't what we want, and it results in ZenPackLib thinking that it doesn't need to create the /Server/Microsoft/Windows device class because it already exists.

This fix should address that problem by adding an additional check to after the call to getOrganizer() that makes sure the returned device class has the same path as what was asked for.

There's a bit of reorganization in this change to put all of the organizer specs under a new abstract base class called OrganizerSpec so that the ability to safely get an organizer can be shared.

Fixes ZPS-1012.

dbouchillon commented 7 years ago

i'm dave and i approve this pull request