TECHZEN Zenoss User Community ARCHIVE  

ZenPack Developers' Guide - input on chapter 3 please

Subject: ZenPack Developers' Guide - input on chapter 3 please
Author: Jane Curry
Posted: 2016-06-22 09:33

Greetings - especially to those who have offered to act as official reviewers for the forthcoming ZenPack Developers' Guide.

There seem to be 2 areas causing comment in chapter 3 that I would appreciate input on - from anyone! I have put my current version of Chapter 3 on github at https://github.com/ZenossDevGuide/DevGuide/blob/master/zenpacks4_5_chap3_jc_20160622.pdf. Anyone is welcome to access it (there is also an updated Table of Contents posted - for my version, not the reviewers version).

Area 1 for comment - Development environment for Zenoss 5 - chapter 3.1.2

=================================================================

I create a zenoss user and give them a bunch of aliases such that I can largely drive ZenPack development in the same way I used to on Zenoss 4. I've tested this on Zenoss 5.0.7 and it appears to work a treat. No broken ZenPacks. No (or very little) hassling around in and out of containers.

StevePC from Zenoss is obviously uncomfortable with this. He has edited out my zenoss user documentation and has several cautious comments in his version of chapter 3.2.4.

I started with Chet's documentation at http://zenpacklib.zenoss.com/en/latest/development-environment-5.html which includes the zenoss user and aliases.

Anyone who has tried this technique, please provide input, either here or post edits back to github.

Area 2 for comment - Installing ZenPacks - chapter 3.4 (github version

===========================================================

Page 39 - the discussion about what happens when you create a ZenPack, copy code from $ZENHOME/ZenPacks to a working directory and then link-install the copy.

Can anyone else confirm my version ie. the directory is removed from $ZENHOME/ZenPacks, just leaving the egg-link pointer I have input that suggests this may vary depending on whether the ZenPack was originally created through the GUI versus with zenpacklib.

Comments welcome here. The focus is on Zenoss 4 for these comments though further input from versions of Zenoss 5 would also be extremelu helpful.

Many thanks,

Jane

Email: jane.curry@skills-1st.co.uk    Web: https://www.skills-1st.co.uk



Subject: Jane,
Author: Chet Luther
Posted: 2016-06-23 13:35

Jane,

I can confirm your version of copying a link-installed ZenPack to another location then link-installing it again on Zenoss 4.2.5.

  1. Create ZenPacks.example.Example in the UI
  2. cp -R /opt/zenoss/ZenPacks/ZenPacks.example.Example /home/zenoss/
  3. zenpack --link --install /home/zenoss/ZenPacks.example.Example

This results in the /opt/zenoss/ZenPacks/ZenPacks.example.Example/ directory being removed, the /opt/zenoss/ZenPacks/ZenPacks.example.Example.egg-link file being updated to point to the new /home/zenoss/ location, and the /opt/zenoss/ZenPacks/easy-install.pth file also being updated to point to the new /home/zenoss/ location. So this results in a ZenPack properly link-installed from the new /home/zenoss/ location. This would be true regardless of whether the ZenPack was created in the UI or with zenpacklib. Though with zenpacklib you would have probably just created it in the desired directory to begin with.



Subject: Many thanks, Chet.
Author: Jane Curry
Posted: 2016-06-24 03:44

Many thanks, Chet.

Can you explain a little more the role of easy-install.pth

Cheers,

Jane

Email: jane.curry@skills-1st.co.uk    Web: https://www.skills-1st.co.uk



Subject: Just tested with a zenpacklib
Author: Jane Curry
Posted: 2016-06-24 09:43

Just tested with a zenpacklib created ZenPack. As Chet says, you create it wherever your source development directory is. Then do a link-install. The egg-link file is created, as usual, in /opt/zenoss/ZenPacks (but nothing else in this directory); the egg-link file points at the source directory.

Cheers,

Jane

Email: jane.curry@skills-1st.co.uk    Web: https://www.skills-1st.co.uk



Subject: Jane,
Author: Chet Luther
Posted: 2016-06-27 15:22

Jane,

Only ZenPacks listed in /opt/zenoss/ZenPacks/easy-install.pth will be loaded when Zenoss starts. Sometimes it can also be useful to know that the __init__.py within each ZenPack is executed in the order that the ZenPack's path is listed in easy-install.pth.

Zenoss 5 tweaks this a little bit. In Zenoss 5 there is an /opt/zenoss/ZenPacks/easy-install.pth just like in Zenoss 4, but there is also a /var/zenoss/ZenPacks/easy-install.pth. The /var/... file is there to support ZenPacks installed with "serviced service run zope zenpack-manger link ...", and generally you don't really need to know about it.



< Previous
How to add fields to the main /Devices class?
  Next
Trouble Understanding WIndows Memory / RAM Utilization Events
>