Ticket #3390 (closed defect: Fixed)
Event Mappings break with Zenpack export/Install
| Reported by: | zenoss | Owned by: | edahl |
|---|---|---|---|
| Priority: | 2 - High | Milestone: | zenoss-2.3 |
| Component: | All | Version: | 2.2.0 |
| Keywords: | Cc: | ||
| Community Patch Attached: | Deployed @ Customer: | ||
| Installer: | Maintenance Target: | ||
| Specific ZenPack: | Maintenance Status: | ||
| Documentation Note?: | Not required | Regression: |
Description
Problem:
Event mappings break when they are exported to a Zenpack and reinstalled if their ID does not match their Event Class Key, this means that you can not have a Zenpack with more than 1 event mapping with the same class key.
Steps to reproduce:
Create 2 events with the same class Key:
Events -> Mappings -> Pull Down: Add mapping -> ID = test -> OK
test -> edit -> Event Class Key: foo -> Save
Events -> Mappings -> Pull Down: Add mapping -> ID = test2 -> OK
test -> edit -> Event Class Key: foo -> Save
NOTE: Under sequence tab: Both events are the same class key so are in the same sequence!
Create a Zenpack and add the events to it:
Settings -> Zenpacks -> Pull Down: Create Zenpack -> Name = ZenPacks.foo.baa -> OK
Events -> test -> Pull Down: more/Add to Zenpack -> ZenPacks.foo.baa -> OK
Events -> test2 -> Pull Down: more/Add to Zenpack -> ZenPacks.foo.baa -> OK
Export, delete & reinstall the Zenpack:
Settings -> Zenpacks -> ZenPacks.foo.baa -> Pull Down: Export Zenpack -> OK
Settings -> Zenpacks -> Tick ZenPacks.foo.baa -> Pull Down: Delete Zenpack -> OK
From the commandl line:
[zenoss@uktest-rtf-zen01 ~]$ zenpack --install=$ZENHOME/export/ZenPacks.foo.baa-1.0-py2.4.egg
INFO:zen.ZPLoader:Loading
/opt/zenoss/ZenPacks/ZenPacks.foo.baa-1.0-py2.4.egg/ZenPacks/foo/baa/objects/objects.xml
INFO:zen.AddToPack:End loading objects
INFO:zen.AddToPack:Processing links
INFO:zen.AddToPack:Loaded 2 objects into database
INFO:zen.HookReportLoader:loading reports
from:/opt/zenoss/ZenPacks/ZenPacks.foo.baa-1.0-py2.4.egg/ZenPacks/foo/baa/reports
[zenoss@uktest-rtf-zen01 ~]$
Check the sequence of our re-imported events:
Events -> test or test 2 -> Sequence
NOTE: Neither event mapping now has a sequence as they were not imported properly and these event mappings will no longer work!!
Expected behaviour:
The event mappings should be imported exactly how they were added to the Zenpack, i.e: they should be listed in the sequence for their class key and more importantly they should continue to function!
Further testing (I've wasted a day on this!!):
The first event mapping will work IF the mapping ID is the same as the event class key. All other mappings with this Class Key will list this 1 mapping (where the ID==classKey) in their sequence tab bu will not be listed themselves. This might hint to the devs where the problem lies.
Host Info:
CentOS release 5 (Final)
Linux uktest-rtf-zen01.uk.ftse.com 2.6.18-53.1.21.el5 #1 SMP Tue May 20 09:34:18 EDT 2008 i686 i686 i386 GNU/Linux
zenoss-core-zenpacks-2.2.0-0
zenoss-2.2.0-0.el5
Monitoring: localhost