ZenPacks, JSON API, and Integrations

Expand all | Collapse all

Trouble getting a ZenPack to install and work

  • 1.  Trouble getting a ZenPack to install and work

    Posted 07-10-2019 04:40 PM
    Edited by Paul Giordano 07-10-2019 04:48 PM
      |   view attached
    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
    ------------------------------

    Attachment(s)

    gz
    ryver.tar.gz   3K 1 version


  • 2.  RE: Trouble getting a ZenPack to install and work

    Posted 07-11-2019 03:02 AM
    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
    ------------------------------



  • 3.  RE: Trouble getting a ZenPack to install and work

    Posted 07-11-2019 11:36 AM
    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
    ------------------------------



  • 4.  RE: Trouble getting a ZenPack to install and work

    Posted 07-12-2019 09:27 AM
    Need the __init__.py in actions directory

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



  • 5.  RE: Trouble getting a ZenPack to install and work

    Posted 07-12-2019 09:45 AM
    I figured it was something simple. Thanks Jay.

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