-
Notifications
You must be signed in to change notification settings - Fork 897
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
Allow a service power state to correctly handle nil actions #13232
Allow a service power state to correctly handle nil actions #13232
Conversation
@gmcculloug - Please review cc @AparnaKarve |
@miq-bot add_label 'blocker', 'services' |
@syncrou Cannot apply the following labels because they are not recognized: 'blocker', 'services' |
b6d7bba
to
ec71612
Compare
@miq-bot add_label blocker, services |
ec71612
to
13244c6
Compare
@miq-bot add_label bug |
end | ||
|
||
def composite? | ||
service_template.service_type == 'composite' |
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.
Does it make sense to delegate
the service_type
? Then you can remove the service_template
reference from atomic?
and composite?
.
In the case where the :start_action or :stop_action was not set on a service we need to assume the user would want a :start_action to equal 'Power On' and subsequently a nil :stop_action would equal a 'Power Off' This change only affects services where none of the start or stop actions were set This change also correctly handles passing back the power state and power status for atomic services If a user sets any of the service actions then we assume they meant to leave some of them as 'Do Nothing' https://bugzilla.redhat.com/show_bug.cgi?id=1394202
13244c6
to
6661b89
Compare
Checked commit syncrou@6661b89 with ruby 2.2.6, rubocop 0.46.0, and haml-lint 0.19.0 spec/models/service_spec.rb
|
Allow a service power state to correctly handle nil actions (cherry picked from commit 656bbc8) https://bugzilla.redhat.com/show_bug.cgi?id=1402995
Euwe backport details:
|
In the case where the :start_action or :stop_action was not set on a service
we need to assume the user would want a :start_action to equal 'Power On'
and subsequently a nil :stop_action would equal a 'Power Off'
This change only affects services where none of the start or stop actions were set
This change also correctly handles passing back the
power state and power status for atomic services
If a user sets any of the service actions then we assume they meant to leave some of them as 'Do Nothing'
https://bugzilla.redhat.com/show_bug.cgi?id=1394202
Steps for Testing/QA
start_action
blank (via the classic UI)power_state
of the service after the VMs for that service have started.Repeat to test the
stop_action
but leave that field blank in the classic UIpower_state
of the service after the VM for the service has started.