Bug 802516

Summary: Add more time-related syntactic sugar to wallaby inventory constraints
Product: Red Hat Enterprise MRG Reporter: Will Benton <willb>
Component: wallaby-utilsAssignee: Will Benton <willb>
Status: CLOSED CURRENTRELEASE QA Contact: MRG Quality Engineering <mrgqe-bugs>
Severity: unspecified Docs Contact:
Priority: low    
Version: 2.1CC: esammons, iboverma, matt, mkudlej, rrati
Target Milestone: 2.3Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: wallaby-0.12.5-2 Doc Type: Enhancement
Doc Text:
C: The expression language supported by the "wallaby inventory -c" command was unnecessarily limited. C: Some constraint expressions, e.g., those dealing with times most appropriately expressed in units other than hours or those dealing with time comparisons, may have been cumbersome or confusing. F: The constraint language supported by the "wallaby inventory" command has been extended. R: It is thus now possible to specify constraints like "last.checkin.was_more_than 2.weeks ago" to find all nodes that have not checked in for the last two weeks.
Story Points: ---
Clone Of:
: 805349 (view as bug list) Environment:
Last Closed: 2012-10-03 19:29:47 UTC Type: ---
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: 805349    

Description Will Benton 2012-03-12 17:40:22 UTC
Description of problem:

"wallaby inventory -c" supports some syntactic sugar to make it easier to write constraints that deal with timestamps.  However, some confusing points remain:

1.  Users may specify, e.g., "1.hour_ago" or "4.hours_ago" to get a timestamp that corresponds to the specified time.  Being able to use other units (weeks, days, etc.) would be useful.
2.  Because of the nature of timestamp-related constraints, the expressions may appear counterintuitive; "last_checkin > 2.hours_ago" would return all nodes who have checked in more recently than two hours ago (since the timestamp of their last checkin was greater than the timestamp corresponding to two hours ago).  We'd read this constraint in colloquial English as "my last checkin was more than two hours ago," which is the opposite of what it means.

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

wallaby-0.12.0-1

Comment 1 Will Benton 2012-03-12 17:46:02 UTC
You may now specify times by using years_ago, minutes_ago, weeks_ago, and days_ago in addition to hours_ago.

Furthermore, the confusing expression in #2 can now be written as "last_checkin.was_less_than 2.hours_ago"

Comment 2 Will Benton 2012-03-12 17:46:02 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
C:  The expression language supported by the "wallaby inventory -c" command was unnecessarily limited.
C:  Some constraint expressions, e.g., those dealing with times most appropriately expressed in units other than hours or those dealing with time comparisons, may have been cumbersome or confusing.
F:  The constraint language supported by the "wallaby inventory" command has been extended.
R:  It is thus now possible to specify constraints like "last.checkin.was_more_than 2.weeks ago" to find all nodes that have not checked in for the last two weeks.