-
Notifications
You must be signed in to change notification settings - Fork 898
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
Add tasks and models for retire as a request #16933
Add tasks and models for retire as a request #16933
Conversation
b3ad86f
to
62ced64
Compare
62ced64
to
8bd5174
Compare
app/models/vm_retire_request.rb
Outdated
SOURCE_CLASS_NAME = 'Vm'.freeze | ||
ACTIVE_STATES = %w(retired) + base_class::ACTIVE_STATES | ||
|
||
validates :request_state, :inclusion => { :in => %w(pending finished) + ACTIVE_STATES }, :message => "should be pending, #{ACTIVE_STATES.join(", ")} or finished" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line breaks the UI change in the associated classic-ui PR
8f8b706
to
9f123f6
Compare
This pull request is not mergeable. Please rebase and repush. |
d7cbaa5
to
774c7f0
Compare
This pull request is not mergeable. Please rebase and repush. |
a9a7774
to
405eb90
Compare
cb3312e
to
b376da7
Compare
841a36e
to
0d789ad
Compare
app/models/vm_retire_request.rb
Outdated
@@ -0,0 +1,10 @@ | |||
class VmRetireRequest < MiqRequest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@d-m-u Should this inherit from MiqRetireRequest?
app/models/service_retire_task.rb
Outdated
Service | ||
end | ||
|
||
def after_request_task_create |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@d-m-u
Can't this function be used from MiqRetireTask?
60455f4
to
4a82497
Compare
app/models/service_retire_task.rb
Outdated
update_attribute(:description, get_description) | ||
end | ||
|
||
def after_ae_delivery(ae_result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@d-m-u Can this also be from MiqRetireTask?
de816b2
to
98ec4bd
Compare
@d-m-u Looks good! |
app/models/miq_retire_task.rb
Outdated
|
||
def self.get_description(req_obj) | ||
name = nil | ||
if req_obj.source.nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name = if req_obj.source.nil?
then you can get rid of all of the other name =
inside the conditional
@@ -0,0 +1,3 @@ | |||
FactoryGirl.define do | |||
factory :orchestration_stack_retire_request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove the empty factories?
fc80a60
to
215f1f0
Compare
215f1f0
to
c4882a5
Compare
Checked commits d-m-u/manageiq@42aebe6~...c4882a5 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 app/models/miq_retire_task.rb
|
:VmRetireRequest => { | ||
:vm_retire => N_("VM Retire") | ||
}, | ||
:ServiceRetireRequest => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally I would complain about this being alphabetical, but it's already messed up ¯\_(ツ)_/¯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's address this in a followup PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VM retirement should be a request. This is ☠️ first pass at creating task and model.
This PR includes the service and orch stack task and request models because it has to in order to pass specs in the retirement manager.
Related to:
classic-ui pr here: ManageIQ/manageiq-ui-classic#3409
automate changes: ManageIQ/manageiq-automation_engine#157
ManageIQ/manageiq-content#262