Bug 1020064

Summary: parentName alert operation tokens resolving to parentId value instead of parentName
Product: [JBoss] JBoss Operations Network Reporter: Marc Shirley <mshirley>
Component: Monitoring - AlertsAssignee: Jay Shaughnessy <jshaughn>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: high Docs Contact:
Priority: unspecified    
Version: JON 3.1.2CC: jbednari, jshaughn, loleary, mhernon
Target Milestone: DR01   
Target Release: JON 3.2.1   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1058945 (view as bug list) Environment:
Last Closed: 2014-05-08 17:43:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1048595, 1058945    

Description Marc Shirley 2013-10-16 23:31:41 UTC
Description of problem:
Alert operation tokens resource.parentName and target.parentName resolve to the parent resource id value instead of the name.

Version-Release number of selected component (if applicable):
JBoss ON 3.1.2

How reproducible:
very

Steps to Reproduce:
1. Import script (below) as a script server resource
2. Set up an alert with an alert notification type of Resource Operation
3. Configure notification to point to the imported script server resource from step 1
4. Configure the arguments of the Execute operation:
      <%resource.parentName%> <%resource.parentId%> <%targetResource.parentName%> <%targetResource.parentId%>
5. Trigger the alert
6. Verify the output of the script


testScript.sh contents:
#!/bin/sh

echo $# number of arguments > output.txt
echo $* >> output.txt
echo $@ >> output.txt


Actual results:
output contains 4 occurrences of the parent resource ids instead of the parent resource names and ids.

Expected results:
The output should contain both the parent resource names and id values.

Comment 1 Jay Shaughnessy 2014-01-06 20:35:56 UTC
I'll see if I can figure this one out...

Comment 2 Jay Shaughnessy 2014-01-06 22:44:41 UTC
master commit 962eda4d551d8185bd75291b37e694891eb04435
Author: Jay Shaughnessy <jshaughn>
Date:   Mon Jan 6 17:32:47 2014 -0500

  Fixed what looks like cut+paste issue.



release/jon3.2.x commit 389de01b266269d8e81b1a5979ecf3bfb349aadc
Author: Jay Shaughnessy <jshaughn>
Date:   Mon Jan 6 17:32:47 2014 -0500

  Cherry Pick of Master 962eda4d551d8185bd75291b37e694891eb04435



release/jon3.1.x commit a8d9a2ac71b57f70236a23cba7b7b0da64e14ec1
Author: Jay Shaughnessy <jshaughn>
Date:   Mon Jan 6 17:32:47 2014 -0500

  Cherry Pick of Master 962eda4d551d8185bd75291b37e694891eb04435

Comment 5 Simeon Pinder 2014-02-18 15:08:18 UTC
Moving to ON_QA as available for testing in the following brew build:
https://brewweb.devel.redhat.com//buildinfo?buildID=336752

Note: the installed version is still JON 3.2.0.GA by design and this represents part of the payload for JON 3.2.1 also known as cumulative patch 1 for 3.2.0.GA.  How this will be delivered to customers is still being discussed.

Comment 6 Jan Bednarik 2014-02-20 16:13:23 UTC
Verified on JON 3.2.1 DR1 (Build Number: c758688:4c03150)

tested using server's CPU0 as an alerting resource. The contents of the output.txt file are correct:

jbe-jon321-server.bc.jonqe.lab.eng.bos.redhat.com 10001 jbe-jon321-server.bc.jonqe.lab.eng.bos.redhat.com 10001
jbe-jon321-server.bc.jonqe.lab.eng.bos.redhat.com 10001 jbe-jon321-server.bc.jonqe.lab.eng.bos.redhat.com 10001

Comment 7 Mike Foley 2014-05-08 17:43:49 UTC
JON 3.2.1 released week of 5/5/2014