Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added vm_retire_extend method for new email. #366

Merged

Conversation

billfitzgerald0120
Copy link
Contributor

Updated System/Request/vm_retire_extend instance to include vm_retire_extend method.
Created tests

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1603881

@billfitzgerald0120
Copy link
Contributor Author

@miq-bot add_label bug

@miq-bot miq-bot added the bug label Jul 20, 2018
@billfitzgerald0120
Copy link
Contributor Author

@tinaafitz Please review

@billfitzgerald0120 billfitzgerald0120 force-pushed the vm_retire_extend_method branch 2 times, most recently from c644e63 to ba28fe9 Compare July 27, 2018 13:13
end

def retirement_extend_days
@vm_retire_extend_days ||= @handle.object['vm_retire_extend_days'] || 14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@billfitzgerald0120
Can you add a constant for 14 at the top of the class

DEFAULT_EXTENSION_DAYS = 14

And then in the method you could use
``
@vm_retire_extend_days ||= @handle.object['vm_retire_extend_days'] || DEFAULT_EXTENSION_DAYS

@mkanoor
Copy link
Contributor

mkanoor commented Jul 27, 2018

@billfitzgerald0120
Have you run the spec with export CI=1 and seen if we have complete coverage. This is a new file so lets make sure we have complete coverage.

@billfitzgerald0120
Copy link
Contributor Author

@mkanoor Added a constant, changed vm.name to vm in multiple places. Coverage is 100% except file statement in method.

def extend_retirement
@handle.log("info", "Number of days to extend: <#{retirement_extend_days}>")
@handle.log("info", "VM: <#{vm}> current retirement date is #{vm.retires_on}")
@handle.log("info", "Extending retirement <#{retirement_extend_days}> days for VM: <#{vm}>")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@billfitzgerald0120 this still needs to be vm.name otherwise you are dealing with the whole vm object.


def extend_retirement
@handle.log("info", "Number of days to extend: <#{retirement_extend_days}>")
@handle.log("info", "VM: <#{vm}> current retirement date is #{vm.retires_on}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@billfitzgerald0120 vm should be vm.name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkanoor Changed vm back to vm.name.

Updated System/Request/vm_retire_extend instance to include vm_retire_extend method for new email.
Created tests

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1603881

Adding tests
Updated method
@miq-bot
Copy link
Member

miq-bot commented Jul 27, 2018

Checked commit billfitzgerald0120@1d76f6d with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
2 files checked, 0 offenses detected
Everything looks fine. 🏆

@billfitzgerald0120
Copy link
Contributor Author

@tinaafitz Please review

Copy link
Member

@tinaafitz tinaafitz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@billfitzgerald0120 Looks good.
@mkanoor Please review.

@mkanoor mkanoor merged commit c104157 into ManageIQ:master Aug 2, 2018
@mkanoor mkanoor added this to the Sprint 92 Ending Aug 13, 2018 milestone Aug 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants