-
Notifications
You must be signed in to change notification settings - Fork 66
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
Conversation
fc6f77c
to
b606a9c
Compare
@rodneyhbrown7 This PR demands a new version of |
ff3d0d1
to
d57cd97
Compare
@@ -0,0 +1,39 @@ | |||
require "xclarity_client" | |||
require "faker" |
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.
Remove unused imports.
d57cd97
to
7c5d32e
Compare
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) |
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.
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) |
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.
We have a ProviderObjectMixin
for stuff like this, check out https://github.com/ManageIQ/manageiq/blob/master/app/models/mixins/provider_object_mixin.rb
# | ||
# @return the LXCA response | ||
# | ||
def change_resource_state(verb) |
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 looks really similar to the method in PhysicalInfraManager::Operations, I wonder if we can generalize that? Maybe some future refactoring
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.
You're right, but I agree with do this refactoring in a separate PR
7c5d32e
to
3a5d931
Compare
Checked commit douglasgabriel@3a5d931 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
I'm closing just to re-execute Travis |
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.
LGTM
Adding physical switch power operations
This PR is able to:
Depends on:
lenovo/xclarity_client#112- Merged