TECHZEN Zenoss User Community ARCHIVE  

Trouble getting a ZenPack to install and work

Subject: Trouble getting a ZenPack to install and work
Author: Paul Giordano
Posted: 2019-07-10 17:40

So I've generated a ZenPack and am trying to install it. It's pretty simple, sends an API request to Ryver (chat system). I did this with an SMS too, so I really just copied that and changed the references. Anyhow, I have a directory structure for ZenPack.zethcon.Ryver in /ZenPack/zethcon/Ryver that looks like so:
.
├── actions

│   └── ryver.py

├── configure.zcml

├── datasources

│   └── __init__.py

├── info.py

├── __init__.py

├── interfaces.py

├── lib

│   ├── __init__.py

│   └── sendRyver.py

├── libexec

│   └── __init__.py

├── migrate

│   └── __init__.py

├── modeler

│   ├── __init__.py

│   └── plugins

│   └── __init__.py

├── parsers

│   └── __init__.py

├── resources

│   └── __init__.py

├── tests

│   └── __init__.py

├── thresholds

│   └── __init__.py

└── zenpack.yaml

11 directories, 17 files

When I do a "python setup.py bdist_egg" the compiles run fine. Then I go to install it, and it installs OK. The trouble comes next when I try to, for example, do a "serviced service run zope zenpack list" (or anything else really zenpack-wise) and I get a long thread dump, the end of which says:
ZopeXMLConfigurationError: File "/opt/zenoss/etc/site.zcml", line 16.2-16.23

ZopeXMLConfigurationError: File "/opt/zenoss/ZenPacks/ZenPacks.zethcon.Ryver-1.0.0dev-py2.7.egg/ZenPacks/zethcon/Ryver/configure.zcml", line 7.4-11.8

ConfigurationError: ('Invalid value for', 'factory', "ImportError: Couldn't import ZenPacks.zethcon.Ryver.actions.ryver, No module named actions.ryver")

Command returned non-zero exit code 3.

Now, there is an actions.ryver, and it's based on a pretty basic thing I found that someone else did. code attached in the tar.

Anyone out there that can tell me what I've missed? I've attached configure.zcml in the tar as well. Actually, I went ahead and put the whole ZenPack in the tar.

Quick warning - the tar is from the root of the zenpack - make a directory called ZenPack.zethcon.Ryver and untar it there.

------------------------------
Paul Giordano
Senior Systems Engineer
Zethcon Corporation
------------------------------


Subject: RE: Trouble getting a ZenPack to install and work
Author: Pheripheral Pheripheral
Posted: 2019-07-11 04:02

Hi,

I don't claim to be an expert on this and i've not tried this out to see if it fixes anything...

but does the configure.zcml need something to pull in the actions directory
something like
<include package=".actions"/>


------------------------------
Pheripheral Pheripheral
------------------------------


Subject: RE: Trouble getting a ZenPack to install and work
Author: Paul Giordano
Posted: 2019-07-11 12:36

So I moved the module from the "actions" directory to the base directory, changed the reference in configure.zcml, and it worked. I tried the include, but got a different failure: 
ConfigurationError: ('Invalid value for', 'package', 'ImportError: Module ZenPacks.zethcon.Ryver has no global actions')
I'd still like to know why it didn't take the other way.

------------------------------
Paul Giordano
Senior Systems Engineer
Zethcon Corporation
------------------------------


Subject: RE: Trouble getting a ZenPack to install and work
Author: Jay Stanley
Posted: 2019-07-12 10:27

Need the __init__.py in actions directory

------------------------------
jstanley
------------------------------


Subject: RE: Trouble getting a ZenPack to install and work
Author: Paul Giordano
Posted: 2019-07-12 10:45

I figured it was something simple. Thanks Jay.

------------------------------
Paul Giordano
Senior Systems Engineer
Zethcon Corporation
------------------------------


< Previous
Expanding the scope of this discussion forum
  Next
Help with Zenpack monitoring and general upgrade/use questions
>