Bug 1400330

Summary: Running OOTB policy events report for 7.days_ago causes exception in miq_expression
Product: Red Hat CloudForms Management Engine Reporter: Dan Clarizio <dclarizi>
Component: ReportingAssignee: Gregg Tanzillo <gtanzill>
Status: CLOSED CURRENTRELEASE QA Contact: Ievgen Zapolskyi <izapolsk>
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.7.0CC: cpelland, izapolsk, jhardy, obarenbo
Target Milestone: GAKeywords: TestOnly
Target Release: 5.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.8.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1401598 (view as bug list) Environment:
Last Closed: 2017-06-12 17:40:26 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:
Bug Depends On:    
Bug Blocks: 1401598    

Description Dan Clarizio 2016-11-30 22:28:31 UTC
Description of problem:
There are 2 policy event reports shipped OOTB.  Running the second one, which lists policy events for the last 7 days, causes an exception.

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

How reproducible:
Consistently

Steps to Reproduce:
1. Run the second policy events report

Actual results:

[----] F, [2016-11-30T13:11:54.977424 #26001:1c4196c] FATAL -- : Error caught: [NoMethodError] undefined method `iso8601' for "7 Days Ago":String
/home/dclarizio/dev/manageiq/lib/miq_expression.rb:978:in `quote'
/home/dclarizio/dev/manageiq/lib/miq_expression.rb:940:in `operands2rubyvalue'
/home/dclarizio/dev/manageiq/lib/miq_expression.rb:457:in `_to_ruby'
/home/dclarizio/dev/manageiq/lib/miq_expression.rb:446:in `to_ruby'
/home/dclarizio/dev/manageiq/lib/miq_expression.rb:775:in `lenient_evaluate'
/home/dclarizio/dev/manageiq/lib/rbac/filterer.rb:557:in `matches_search_filters?'
/home/dclarizio/dev/manageiq/lib/rbac/filterer.rb:225:in `block in search'
/home/dclarizio/.rvm/gems/ruby-2.3.0/gems/activerecord-5.0.0.1/lib/active_record/relation/delegation.rb:38:in `each'
/home/dclarizio/.rvm/gems/ruby-2.3.0/gems/activerecord-5.0.0.1/lib/active_record/relation/delegation.rb:38:in `each'
/home/dclarizio/dev/manageiq/lib/rbac/filterer.rb:225:in `reject'
/home/dclarizio/dev/manageiq/lib/rbac/filterer.rb:225:in `search'
/home/dclarizio/dev/manageiq/lib/rbac/filterer.rb:97:in `search'
/home/dclarizio/dev/manageiq/lib/rbac.rb:3:in `search'

Expected results:

Report runs

Additional info:

Comment 2 Gregg Tanzillo 2016-12-02 15:15:17 UTC
PR- https://github.com/ManageIQ/manageiq/pull/12961

Comment 4 Gregg Tanzillo 2016-12-06 14:17:10 UTC
*** Bug 1401933 has been marked as a duplicate of this bug. ***

Comment 5 CFME Bot 2016-12-06 17:14:12 UTC
New commit detected on ManageIQ/manageiq/euwe:
https://github.com/ManageIQ/manageiq/commit/e14f883f5f4d21bfc45354e3afe81bd313d7b66e

commit e14f883f5f4d21bfc45354e3afe81bd313d7b66e
Author:     Oleg Barenboim <chessbyte>
AuthorDate: Fri Dec 2 12:09:54 2016 -0500
Commit:     Oleg Barenboim <chessbyte>
CommitDate: Fri Dec 2 12:10:53 2016 -0500

    Merge pull request #12961 from gtanzillo/bz-1400330-7-days-ago
    
    Used correct date/time comparison operator for OOTB Policy Events report
    (cherry picked from commit 3794af123f30ffc5c75207ced0de3123451869ce)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1400330

 product/reports/520_Events - Policy/120_Policy Events2.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 6 CFME Bot 2016-12-06 17:15:36 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/946dca7797f45295ca15e528debba1c8c5de73dc

commit 946dca7797f45295ca15e528debba1c8c5de73dc
Author:     Gregg Tanzillo <gtanzill>
AuthorDate: Fri Dec 2 10:02:07 2016 -0500
Commit:     Gregg Tanzillo <gtanzill>
CommitDate: Fri Dec 2 10:02:07 2016 -0500

    Updated deprecated date/time comparison operator ">=" to use the correct operator "after"
    
    That operator was removed for date/time fields in https://github.com/ManageIQ/manageiq/pull/10295
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1400330

 product/reports/520_Events - Policy/120_Policy Events2.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)