TECHZEN Zenoss User Community ARCHIVE  

Where to place common code in a zenpack

Subject: Where to place common code in a zenpack
Author: [Not Specified]
Posted: 2014-09-25 09:29

I have a Zenpack which reuses common python code between modeler/monitoring templates/parsers.
Where can I place this code, so it is accessible at all places but localized within the zenpack alone.
I currently put them inside python site-packages.

What changes are needed to access them anywhere.

PYTHONPATH is different between zenoss environment and ordinary system.
PYTHONPATH is located within /opt/zenoss/lib/python and site-packages are local to it.
While the system has its own python library located in /usr/lib/pythonxx/site-packages.
Now when I install any packages even while being a zenoss user, the installation path goes into system wide environment and not within zenoss python path.

What is the best way to install a python module within zenoss environment.

Your inputs are much appreciated.
Thanks



Subject: Your zenpack can have its own
Author: Jay Stanley
Posted: 2014-10-02 15:10

Your zenpack can have its own libs directory to call on.

I am not a python master (still learning), but can't you just have a common.py in the base dir and then import from your other scripts



< Previous
zenpack install failure
  Next
Zendisc fails on 4.2.5 SP203 "devices restricted to class Device. <Device> is cl ...
>