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

Allow a service power state to correctly handle nil actions #13232

Merged
merged 1 commit into from
Jan 23, 2017

Conversation

syncrou
Copy link
Contributor

@syncrou syncrou commented Dec 16, 2016

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

  1. Build a Bundled Service
  2. Leave the start_action blank (via the classic UI)
  3. Start the service - the SUI should show the correct 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 UI

  1. Build an (atomic) Service
  2. Start the service - the SUI should show the correct power_state of the service after the VM for the service has started.

@syncrou
Copy link
Contributor Author

syncrou commented Dec 16, 2016

@gmcculloug - Please review

cc @AparnaKarve

@syncrou
Copy link
Contributor Author

syncrou commented Dec 16, 2016

@miq-bot add_label 'blocker', 'services'

@miq-bot
Copy link
Member

miq-bot commented Dec 20, 2016

@syncrou Cannot apply the following labels because they are not recognized: 'blocker', 'services'

@syncrou syncrou force-pushed the assume_when_all_nil_actions branch from b6d7bba to ec71612 Compare December 21, 2016 15:40
@syncrou
Copy link
Contributor Author

syncrou commented Dec 21, 2016

@miq-bot add_label blocker, services

@syncrou
Copy link
Contributor Author

syncrou commented Dec 21, 2016

@miq-bot add_label bug

end

def composite?
service_template.service_type == 'composite'
Copy link
Member

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
@syncrou syncrou force-pushed the assume_when_all_nil_actions branch from 13244c6 to 6661b89 Compare January 23, 2017 21:30
@miq-bot
Copy link
Member

miq-bot commented Jan 23, 2017

Checked commit syncrou@6661b89 with ruby 2.2.6, rubocop 0.46.0, and haml-lint 0.19.0
2 files checked, 1 offense detected

spec/models/service_spec.rb

@gmcculloug gmcculloug merged commit 656bbc8 into ManageIQ:master Jan 23, 2017
@gmcculloug gmcculloug added this to the Sprint 53 Ending Jan 30, 2017 milestone Jan 23, 2017
simaishi pushed a commit that referenced this pull request Jan 23, 2017
Allow a service power state to correctly handle nil actions
(cherry picked from commit 656bbc8)

https://bugzilla.redhat.com/show_bug.cgi?id=1402995
@simaishi
Copy link
Contributor

Euwe backport details:

$ git log -1
commit a5486c586099a8312e5ac8dddd4969b3980e5b99
Author: Greg McCullough <[email protected]>
Date:   Mon Jan 23 16:59:02 2017 -0500

    Merge pull request #13232 from syncrou/assume_when_all_nil_actions
    
    Allow a service power state to correctly handle nil actions
    (cherry picked from commit 656bbc8e32f9b2d8a64d2e998350fb6f73b75a14)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1402995

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants