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

Parsing physical rack #147

Merged
merged 1 commit into from
Apr 4, 2018
Merged

Conversation

felipedf
Copy link
Member

@felipedf felipedf commented Mar 29, 2018

Parse info from a PhysicalRack

@miq-bot miq-bot added the wip label Mar 29, 2018
@felipedf felipedf force-pushed the parse_physical_rack branch 2 times, most recently from 69dadb8 to daf0b35 Compare March 29, 2018 21:13
@felipedf felipedf changed the title [WIP] Parsing physical rack + testing Parsing physical rack Mar 29, 2018
@miq-bot miq-bot removed the wip label Mar 29, 2018
@felipedf
Copy link
Member Author

felipedf commented Mar 29, 2018

The Travis error is due the server[:rack] field that is not deleted after parsing, this is done here ManageIQ/manageiq#16853 and will be ok after merge. @agrare

@miq-bot
Copy link
Member

miq-bot commented Mar 29, 2018

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

@rodneyhbrown7
Copy link
Contributor

Can you rebase this with master?

@felipedf felipedf force-pushed the parse_physical_rack branch 2 times, most recently from feb33c9 to 08acf5f Compare April 2, 2018 12:31
@felipedf
Copy link
Member Author

felipedf commented Apr 2, 2018

Done

@felipedf
Copy link
Member Author

felipedf commented Apr 4, 2018

@miq-bot assign @agrare

@agrare
Copy link
Member

agrare commented Apr 4, 2018

@felipedf can you add some tests to the full refresh test to check for the physical racks and the association between the physical servers and the physical racks?

Convention here would be to add a assert_specific_rack to check for a specific rack's attributes and a assert_specific_server where you can check the server has a relationship back to the rack.

has_many :physical_racks, :foreign_key => "ems_id", :dependent => :destroy, :inverse_of => :ext_management_system,
:class_name => "ManageIQ::Providers::Lenovo::PhysicalInfraManager::PhysicalRack"
has_many :physical_servers, :foreign_key => "ems_id", :dependent => :destroy, :inverse_of => :ext_management_system,
:class_name => "ManageIQ::Providers::Lenovo::PhysicalInfraManager::PhysicalServer"
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the physical_racks and physical_servers associations be on the core physical_infra_manager? And you shouldn't need the class name as long as the assoc name matches the base class name

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, all should be on base models

:class_name => "ManageIQ::Providers::Lenovo::PhysicalInfraManager"

belongs_to :physical_rack, :dependent => :destroy, :inverse_of => :physical_servers,
:class_name => "ManageIQ::Providers::Lenovo::PhysicalInfraManager::PhysicalRack"
Copy link
Member

Choose a reason for hiding this comment

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

Again I think all of these associations should be defined on the base models without the class_name, not here

:class_name => "ManageIQ::Providers::Lenovo::PhysicalInfraManager"

has_many :physical_servers, :dependent => :destroy, :inverse_of => :physical_rack,
:class_name => "ManageIQ::Providers::Lenovo::PhysicalInfraManager::PhysicalServer"
Copy link
Member

Choose a reason for hiding this comment

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

Same this should be in the base model

@felipedf felipedf force-pushed the parse_physical_rack branch 2 times, most recently from 545f851 to 384f67f Compare April 4, 2018 15:13
agrare added a commit to agrare/manageiq-providers-lenovo that referenced this pull request Apr 4, 2018
@miq-bot
Copy link
Member

miq-bot commented Apr 4, 2018

Checked commit felipedf@dc44ffa with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
10 files checked, 0 offenses detected
Everything looks fine. 🍪

@agrare agrare merged commit eac5876 into ManageIQ:master Apr 4, 2018
@agrare agrare added this to the Sprint 83 Ending Apr 9, 2018 milestone Apr 4, 2018
@felipedf felipedf deleted the parse_physical_rack branch May 4, 2018 18:41
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