Bug 1427503

Summary: VM extend retirement fails
Product: Red Hat CloudForms Management Engine Reporter: Sachin <sacpatil>
Component: AutomateAssignee: Tina Fitzgerald <tfitzger>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Shriver <mshriver>
Severity: high Docs Contact:
Priority: high    
Version: 5.7.0CC: cpelland, dajohnso, gmccullo, jhardy, mkanoor, mshriver, obarenbo, simaishi, tfitzger
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.8.0Flags: mshriver: automate_bug+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: retirement
Fixed In Version: 5.8.0.7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1433980 (view as bug list) Environment:
Last Closed: 2017-06-12 16:25:10 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: 1433980    

Description Sachin 2017-02-28 12:20:14 UTC
Description of problem:

Not able to extend VM retirement date using instruction given on
https://access.redhat.com/documentation/en-us/red_hat_cloudforms/4.2/html-single/provisioning_virtual_machines_and_hosts/#extending-retirement-dates


This was not seen in 5.6.1.2
~~~
irb(main):002:0> e.retires_on
=> Fri, 28 Apr 2017
irb(main):003:0> e.retires_on += 1
=> Sat, 29 Apr 2017
irb(main):004:0> e.retires_on.class
=> Date
~~~


But observed in 5.7.0.17
~~~
irb(main):020:0> e.retires_on
=> Tue, 28 Mar 2017 00:04:52 UTC +00:00
irb(main):021:0> e.retires_on += 1
=> Tue, 28 Mar 2017 00:04:53 UTC +00:00
irb(main):022:0> e.retires_on.class
=> ActiveSupport::TimeWithZone
irb(main):024:0> e.retires_on
=> Tue, 28 Mar 2017 00:04:53 UTC +00:00
irb(main):025:0> e.retires_on += 30.days
=> Thu, 27 Apr 2017 00:04:53 UTC +00:00
~~~


Minor changes needed in manageiq-content/content/automate/ManageIQ/Infrastructure/VM/Retirement/Email.class/__methods__/vm_retire_extend.rb


- vm.retires_on += vm_retire_extend_days.to_i
+ vm.retires_on += vm_retire_extend_days.to_i.days


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

How reproducible:
Aways


Steps to Reproduce:
Follow 

https://access.redhat.com/documentation/en-us/red_hat_cloudforms/4.2/html-single/provisioning_virtual_machines_and_hosts/#extending-retirement-dates


Actual results:


Expected results:


Additional info:

Comment 5 CFME Bot 2017-03-16 16:11:16 UTC
New commit detected on ManageIQ/manageiq/master:
https://github.com/ManageIQ/manageiq/commit/ddb92386ddc38e5eb908e02702fd01f48b6b9426

commit ddb92386ddc38e5eb908e02702fd01f48b6b9426
Author:     Tina Fitzgerald <tfitzger>
AuthorDate: Thu Mar 2 14:09:24 2017 -0500
Commit:     Tina Fitzgerald <tfitzger>
CommitDate: Thu Mar 9 13:56:38 2017 -0500

    Fix extend_retires_on method for number of days.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1427503

 app/models/mixins/retirement_mixin.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comment 7 Mike Shriver 2017-03-27 17:58:23 UTC
Verified in CFME 5.8.0.7

A rhevm virtual machine with a set retirement date can have its retirement date extended by using the automation buttons.  The retirement date was extended the default value of 14 days past the originally set date.