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

Adding physical switch power operations #177

Merged
merged 1 commit into from
Jun 7, 2018

Conversation

douglasgabriel
Copy link
Member

@douglasgabriel douglasgabriel commented May 22, 2018

This PR is able to:

  • Add the physical switch power operation;
  • Add specs for it;

Depends on:
lenovo/xclarity_client#112 - Merged

@douglasgabriel
Copy link
Member Author

@rodneyhbrown7 This PR demands a new version of xclarity_client.

@douglasgabriel douglasgabriel force-pushed the switch_power_op branch 2 times, most recently from ff3d0d1 to d57cd97 Compare May 22, 2018 18:54
@@ -0,0 +1,39 @@
require "xclarity_client"
require "faker"
Copy link
Member

Choose a reason for hiding this comment

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

Remove unused imports.

def change_resource_state(verb)
$lenovo_log.info("The :#{verb} for Physical Switch with uuid: #{uid_ems} is in progress")

ems = ExtManagementSystem.find(ems_id)
Copy link
Member

Choose a reason for hiding this comment

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

You should have access to the #ext_management_system attribute without looking up by ems_id

$lenovo_log.info("The :#{verb} for Physical Switch with uuid: #{uid_ems} is in progress")

ems = ExtManagementSystem.find(ems_id)
response = ems.connect.send(verb, uid_ems)
Copy link
Member

Choose a reason for hiding this comment

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

#
# @return the LXCA response
#
def change_resource_state(verb)
Copy link
Member

Choose a reason for hiding this comment

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

This looks really similar to the method in PhysicalInfraManager::Operations, I wonder if we can generalize that? Maybe some future refactoring

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, but I agree with do this refactoring in a separate PR

@miq-bot
Copy link
Member

miq-bot commented Jun 6, 2018

Checked commit douglasgabriel@3a5d931 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
4 files checked, 0 offenses detected
Everything looks fine. 👍

@douglasgabriel
Copy link
Member Author

douglasgabriel commented Jun 7, 2018

I'm closing just to re-execute Travis

Copy link
Member

@agrare agrare left a comment

Choose a reason for hiding this comment

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

LGTM

@agrare agrare merged commit 3a5d931 into ManageIQ:master Jun 7, 2018
agrare added a commit that referenced this pull request Jun 7, 2018
Adding physical switch power operations
@agrare agrare added this to the Sprint 88 Ending Jun 18, 2018 milestone Jun 7, 2018
@douglasgabriel douglasgabriel deleted the switch_power_op branch June 7, 2018 17:48
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