TECHZEN Zenoss User Community ARCHIVE  

Updating zProperties in zenpack.yaml not Propagating

Subject: Updating zProperties in zenpack.yaml not Propagating
Author: [Not Specified]
Posted: 2016-02-18 10:53

I am working through the zenpack development tutorials, and after creating the zenpack.yaml file with the default zWundergroundLocations listed in the tutorial and installing the zenpack, I decided I wanted to change the default locations. I reinstalled the zenpack and then restarted RM, but my changes to the default locations are nowhere to be found. Is there a step I am missing

The tutorial is here:http://zenpacklib.zenoss.com/en/latest/tutorial-http-api/create-zenpack-5.html

And the changes I'm making are to this bit here, I'm just changing the cities from Austin to elsewhere:

zProperties:
DEFAULTS:
category: Weather Underground

zWundergroundAPIKey: {}
zWundergroundLocations:
type: lines
default:
- Austin, TX
- San Jose, CA
- Annapolis, MD

Thanks!



Subject: There are two ways to "deal
Author: Chet Luther
Posted: 2016-02-18 16:22

There are two ways to "deal with" zProperties in your zenpack.yaml.

The first that your snippet shows involves creating a new zProperty, and it's done by specifying a "zProperties" section at the root level (not indented) of zenpack.yaml. A zProperty's default values will remain the same once it's created even if they're changed in zenpack.yaml and the ZenPack is installed again. They would be reset if you removed the ZenPack, then reinstalled it. This is because removing the ZenPack removes the zProperty entirely.

The second place that you can deal with zProperties is per-deviceclass. This is where you override the zProperty's value. The zProperty must first exist either in the system already, or as defined in the root-level zProperties section of your zenpack.yaml. These values will be updated based on what's in zenpack.yaml each time the ZenPack is installed or upgraded. It would look something like this.

device_classes:
/WeatherUnderground:
zProperties:
zWundergroundLocations:
- Boston, MA
- New York, NY
- Chicago, IL


Subject: I reviewed the tutorial again
Author: [Not Specified]
Posted: 2016-02-26 09:44

I reviewed the tutorial again, and actually found that the device class is added, and I think I added it, soI'm not sure why I wasn't able to get any locations until I added it in through the UI. Anyway, just wanted to follow up to keep anyone else from getting confused. Thanks!



< Previous
Layer2 Zenpack
  Next
Example of zenpacklib
>