Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1434553 - Policy conditions based on 'VM and Instance.vLANs' field not working
Policy conditions based on 'VM and Instance.vLANs' field not working
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Control (Show other bugs)
5.7.0
All All
medium Severity medium
: GA
: 5.8.0
Assigned To: Lucy Fu
Dmitry Misharov
control:policy:condition
: ZStream
Depends On:
Blocks: 1437146
  Show dependency treegraph
 
Reported: 2017-03-21 13:38 EDT by Ryan Spagnola
Modified: 2017-09-26 06:11 EDT (History)
4 users (show)

See Also:
Fixed In Version: 5.8.0.8
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1437146 (view as bug list)
Environment:
Last Closed: 2017-05-31 10:43:19 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: Bug
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:1367 normal SHIPPED_LIVE Moderate: CFME 5.8.0 security, bug, and enhancement update 2017-05-31 14:16:03 EDT

  None (edit)
Description Ryan Spagnola 2017-03-21 13:38:06 EDT
Description of problem:
Using ‘VM and Instance.vLANs.name' or ‘VM and Instance.vLANs.uid_ems' do not work, they always evaluate to 'false' regardless of the criteria. Below is an example


Version-Release number of selected component (if applicable):
CF 4.2


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Example condition: 
==============
( VM and Instance : Name = "gk-cfci-03" AND VM and Instance.vLANs : Uid Ems CONTAINS "dvportgroup-36" AND VM and Instance.vLANs : Name CONTAINS "602-vd-OOB_MGMT" )

Policy simulation result for VM named 'gk-cfci-03':
=================================
- VM and Instance: Name = 'go-cfci-03'  returns 'true'
- VM and Instance.vLANs : Uid Ems CONTAINS "dvportgroup-36"  returns 'false'
- VM and Instance.vLANs : Name CONTAINS "602-vd-OOB_MGMT" returns 'false'

Rails Console listing of 'gk-cfci-03's LANs:
==========================
irb(main):012:0> Vm.find_by(name: 'gk-cfci-03', active: true).lans.each{|lan| pp lan};0
#<Lan:0x0000000a204388
 id: 10000000000645,
 switch_id: 10000000000003,
 name: "602-vd-OOB_MGMT",
 tag: "",
 created_on: Tue, 28 Feb 2017 17:59:44 UTC +00:00,
 updated_on: Tue, 28 Feb 2017 17:59:44 UTC +00:00,
 uid_ems: "dvportgroup-36",
 allow_promiscuous: false,
 forged_transmits: false,
 mac_changes: false,
 computed_allow_promiscuous: nil,
 computed_forged_transmits: nil,
 computed_mac_changes: nil>
#<Lan:0x0000000a20fa08
 id: 10000000000645,
 switch_id: 10000000000003,
 name: "602-vd-OOB_MGMT",
 tag: "",
 created_on: Tue, 28 Feb 2017 17:59:44 UTC +00:00,
 updated_on: Tue, 28 Feb 2017 17:59:44 UTC +00:00,
 uid_ems: "dvportgroup-36",
 allow_promiscuous: false,
 forged_transmits: false,
 mac_changes: false,
 computed_allow_promiscuous: nil,
 computed_forged_transmits: nil,
 computed_mac_changes: nil>
=> 0
Comment 5 CFME Bot 2017-03-28 10:06:38 EDT
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/b3c3ea9451d0543ca02a3c322a6cc90005a5710e

commit b3c3ea9451d0543ca02a3c322a6cc90005a5710e
Author:     Lucy Fu <lufu@redhat.com>
AuthorDate: Thu Mar 23 15:16:51 2017 -0400
Commit:     Lucy Fu <lufu@redhat.com>
CommitDate: Tue Mar 28 09:31:45 2017 -0400

    Fix an issue in Condition where fields of virtual associations can't be evaluated.
    
    Virtual associations are not checked when navigating down the relationships.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1434553

 lib/extensions/ar_taggable.rb           | 2 +-
 spec/lib/extensions/ar_taggable_spec.rb | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)
Comment 7 Dmitry Misharov 2017-04-11 03:31:04 EDT
Verified in 5.8.0.9-alpha2.20170404195944_1d7ece4. "VM and Instance.vLANs.name" and "VM and Instance.vLANs.uid_ems" criterias work as expected.
Comment 9 errata-xmlrpc 2017-05-31 10:43:19 EDT
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://access.redhat.com/errata/RHSA-2017:1367

Note You need to log in before you can comment on or make changes to this bug.