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

Parse Physical Chassis #149

Merged
merged 1 commit into from
Apr 19, 2018
Merged

Parse Physical Chassis #149

merged 1 commit into from
Apr 19, 2018

Conversation

caiocmpaes
Copy link
Contributor

@caiocmpaes caiocmpaes commented Mar 29, 2018

  • Parse Physical Chassis informations and maps the relationship to Physical Servers that live inside a chassi.
  • Added chassis to the /cabinet mock.

Depends on:

@rodneyhbrown7
Copy link
Contributor

The plural and singular spellings of chassis are the same. Can you change all instances of 'chassi' or 'Chassi' to 'chassis' or 'chassis'?

@caiocmpaes caiocmpaes changed the title Parse Physical Chassis + Tests + Refactoring of Refresh Parser structure [WIP] Parse Physical Chassis + Tests + Refactoring of Refresh Parser structure Apr 2, 2018
@miq-bot miq-bot added the wip label Apr 2, 2018
@caiocmpaes caiocmpaes changed the title [WIP] Parse Physical Chassis + Tests + Refactoring of Refresh Parser structure [WIP] Parse Physical Chassis + Tests Apr 2, 2018
@miq-bot
Copy link
Member

miq-bot commented Apr 4, 2018

This pull request is not mergeable. Please rebase and repush.

@caiocmpaes caiocmpaes changed the title [WIP] Parse Physical Chassis + Tests Parse Physical Chassis + Tests Apr 11, 2018
@caiocmpaes caiocmpaes changed the title Parse Physical Chassis + Tests Parse Physical Chassis Apr 12, 2018
class PhysicalChassisParser < ComponentParser
class << self
# parse a node object to a hash with physical chassis data
# @param [XClarityClient::Node] node - object containing physical chassis data
Copy link
Member

Choose a reason for hiding this comment

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

I think that you will want to change the @param to its new name chassi_hash and add some comment about the rack param.

@@ -13,12 +13,13 @@ class << self
#
# @return [Hash] containing the physical server information
#
def parse_physical_server(node, rack = nil)
def parse_physical_server(node_hash, rack = nil, chassis = nil)
Copy link
Member

Choose a reason for hiding this comment

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

Please, also update the param name on doc comment

Copy link
Member

Choose a reason for hiding this comment

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

Would be good add something about the new params rack and chassis, too

@@ -0,0 +1,28 @@
module ManageIQ::Providers
class Lenovo::PhysicalInfraManager::PhysicalChassis < ::PhysicalChassis
delegate :product_name,
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if this delegate strategy is good here, seems like it is a good thing when you want to support some code that already access this properties like chassis.product_name, for example, which is not the case once it is a new component. What do you think @agrare , is there some pattern about this strategy?

expect(result[:physical_chassis].size).to eq(1)
end

it 'will parse physical chassi fields' do
Copy link
Member

Choose a reason for hiding this comment

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

I think that you wanted to write chassis here

end

it 'will parse physical chassi fields' do
physical_chassi = result[:physical_chassis].first
Copy link
Member

Choose a reason for hiding this comment

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

Also here should be physical_chassis

physical_rack = result[:physical_racks].first
physical_chassis = result[:physical_chassis].first

expect(physical_chassis[:physical_rack][:ems_ref]).to eq(physical_rack[:ems_ref])
Copy link
Member

@douglasgabriel douglasgabriel Apr 12, 2018

Choose a reason for hiding this comment

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

Seems like this is a redundant test if you are verifying the equality between physical_chassis[:physical_rack] and physical_rack as you do bellow.

physical_server = @result[:physical_servers][1]
physical_chassis = @result[:physical_chassis][0]

expect(physical_server[:physical_chassis][:ems_ref]).to eq(physical_chassis[:ems_ref])
Copy link
Member

Choose a reason for hiding this comment

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

Same redundancy that I commented before 😄

@miq-bot
Copy link
Member

miq-bot commented Apr 16, 2018

This pull request is not mergeable. Please rebase and repush.

@caiocmpaes caiocmpaes changed the title Parse Physical Chassis [WIP] Parse Physical Chassis Apr 16, 2018
@miq-bot miq-bot added the wip label Apr 16, 2018
@caiocmpaes caiocmpaes changed the title [WIP] Parse Physical Chassis Parse Physical Chassis Apr 16, 2018
@caiocmpaes
Copy link
Contributor Author

@douglasgabriel I fixed all the corrections that you pointed. Thank you!

Also, I rebased my code after the refactoring of "relative requires".

@miq-bot
Copy link
Member

miq-bot commented Apr 18, 2018

This pull request is not mergeable. Please rebase and repush.

@agrare
Copy link
Member

agrare commented Apr 18, 2018

@caiocmpaes can you rebase this PR?

@douglasgabriel
Copy link
Member

Thanks @caiocmpaes , LGTM now 👍 Only needing the rebase that @agrare mentioned

@caiocmpaes
Copy link
Contributor Author

Rebased @agrare

@agrare
Copy link
Member

agrare commented Apr 18, 2018

@caiocmpaes this changeset still does not apply cleanly

@caiocmpaes
Copy link
Contributor Author

Now Its is rebased again, @agrare

@miq-bot
Copy link
Member

miq-bot commented Apr 19, 2018

Checked commit https://github.com/caiocmpaes/manageiq-providers-lenovo/commit/69e65780de780eafd353bb7f1aa1a5f3c487145b with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
10 files checked, 1 offense detected

**

  • 💣 💥 🔥 🚒 - Linter/Yaml - missing config files

@rodneyhbrown7 rodneyhbrown7 merged commit 1c3f423 into ManageIQ:master Apr 19, 2018
@caiocmpaes caiocmpaes deleted the parse_physical_chassi branch April 19, 2018 16:31
@agrare agrare added this to the Sprint 84 Ending Apr 23, 2018 milestone Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants