14. Setuptools and the zenpacksupport egg

Zenoss requires a Python module called setuptools to create and install eggs. Setuptools is installed by the Zenoss installer in $ZENHOME/lib/python. Zenoss also provides a module named zenpacksupport which extends setuptools. Zenpacksupport defines additional metadata that is written to and read from ZenPack eggs. This metadata is provided through additional options passed to the setup() call in a ZenPack's setup.py file. Those arguments are:

  • compatZenossVers

    This is the version spec representing the required Zenoss version from the ZenPack's edit page.

  • prevZenPackName

    This is the name of the old-style (non-egg) ZenPack that this ZenPack replaces. If a ZenPack with this name is installed in Zenoss then it is upgraded and replaced when this ZenPack is installed. For example, if HttpMonitor is installed and then ZenPacks.zenoss.HttpMonitor is installed (which has prevZenPackName=HttpMonitor) then ZenPacks.zenoss.HttpMonitor will replace HttpMonitor. All packable objects in the database that are included in HttpMonitor will be added to ZenPacks.zenoss.HttpMonitor instead. A migrate script is usually required to set __class__ correctly on instances of ZenPack-provided classes in the object database. ZenPacks.zenoss.HttpMonitor has an example of this in its migrate directory, ConvertHttpMonitorDataSources.py.