Bug 1411511

Summary: Notifications - subject may not have tenant.
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: ApplianceAssignee: Šimon Lukašík <slukasik>
Status: CLOSED ERRATA QA Contact: Pavol Kotvan <pakotvan>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 5.7.0CC: abellott, jhardy, obarenbo, simaishi, slukasik, tfitzger, wfitzger
Target Milestone: GAKeywords: ZStream
Target Release: 5.7.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: cfme_tenant:notification
Fixed In Version: 5.7.1.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1400246 Environment:
Last Closed: 2017-02-27 19:19:26 UTC Type: ---
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: 1400246    
Bug Blocks:    
Attachments:
Description Flags
Simulation
none
TestNotification instance
none
TestNotification method
none
Simulation
none
TestNotification method none

Comment 2 CFME Bot 2017-01-09 21:21:03 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/ab70868bc73d23e8b64c7ed63cfa3c1948fb82f9

commit ab70868bc73d23e8b64c7ed63cfa3c1948fb82f9
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Fri Dec 9 10:33:06 2016 -0500
Commit:     Satoe Imaishi <simaishi>
CommitDate: Mon Jan 9 16:19:30 2017 -0500

    Merge pull request #13081 from isimluk/rhbz#1400246
    
    Notifications: use initiator's tenant when subject lacks tenant relationship
    (cherry picked from commit 6f6b52676964eacb45f3102813b05607d9894d9a)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1411511

 app/models/notification_type.rb  |  6 +++++-
 spec/models/notification_spec.rb | 11 +++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)

Comment 3 Šimon Lukašík 2017-01-18 12:05:41 UTC
In euwe since: ab70868bc73d23e8b64c7ed63cfa3c1948fb82f9

Comment 6 William Fitzgerald 2017-02-20 16:48:58 UTC
Created attachment 1255823 [details]
Simulation

Comment 7 William Fitzgerald 2017-02-20 17:15:00 UTC
Pavol,

To test notification do the following:

- Create System/Request/TestNotification instance.
- Configure System/Request/TestNotification instance to run TestNotification method.
- Create System/Request/TestNotification method.
- Navigate to Automation/Automate/Simulation
- Select Request
- Set Message to ‘create'
- Set Request to 'TestNotification'
- Select Host / Node for type
- Set Selection to an available host.
- Click on Execute Methods
- Select submit and run

If you check the Automation.log you will see the following:

[----] I, [2017-02-17T16:54:56.290781 #646:3fe71ad018d0]  INFO -- : Validating Notification type: automate_tenant_info
[----] I, [2017-02-17T16:54:56.296053 #646:3fe71ad018d0]  INFO -- : Calling Create Notification type: automate_tenant_info subject type: Host id: 6 options: {}

You will also see an entry every time it runs in the Notifications table.

If there is a problem, you should be able to see it in the automation.log.

Let me know if you have any problem or questions.

Thanks

Billy

Comment 8 William Fitzgerald 2017-02-20 17:16:40 UTC
Created attachment 1255833 [details]
TestNotification instance

Comment 9 William Fitzgerald 2017-02-20 17:18:23 UTC
Created attachment 1255836 [details]
TestNotification method

Comment 10 William Fitzgerald 2017-02-20 17:19:20 UTC
Created attachment 1255837 [details]
Simulation

Comment 11 William Fitzgerald 2017-02-20 17:25:00 UTC
Pavol,

Here is my method:

#
# Description: Test Notification 
#

$evm.log("info", "notification test")
host = $evm.root['host']
n = $evm.create_notification(:type => :automate_tenant_info, :subject => host)
$evm.log("info", "notification returned: #{n.inspect}")



Billy

Comment 12 William Fitzgerald 2017-02-20 17:32:30 UTC
Created attachment 1255841 [details]
TestNotification method

Comment 15 errata-xmlrpc 2017-02-27 19:19:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2017-0320.html