Ticket #3390 (closed defect: Fixed)

Opened 7 months ago

Last modified 3 months ago

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

Change History

Changed 7 months ago by zenoss

Related forum post created for awareness:

http://community.zenoss.com/forums/viewtopic.php?p=21752

Changed 7 months ago by zenoss

NOTE: Please follow the steps in the forum post as they're easier to follow (Trac formatting missed a few new line chars) and a typo in the above has been corrected (setting the event class key to foo for "test" twice instead of "test" & "test2").

Changed 7 months ago by cluther

I believe this is a duplicate of #3388, but I'm not closing the ticket because I'm not totally sure it is the same issue.

Changed 7 months ago by zenoss

It may be related to 3388, however performing a reIndex after the process listed above does not fix the problem in this case.

Changed 4 months ago by bbibeault

  • milestone set to zenoss-2.3
  • reviewed set to 0

Changed 3 months ago by bbibeault

  • keywords event mapping zenpack import install export break broke removed
  • status changed from new to closed
  • resolution set to fixed
  • reviewed changed from 0 to 1
Note: See TracTickets for help on using tickets.