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

Add accessors for physical chassis tree #17940

Merged
merged 1 commit into from
Sep 10, 2018

Conversation

tadeboro
Copy link
Contributor

@tadeboro tadeboro commented Sep 4, 2018

This commit exposes database schema changes from ManageIQ/manageiq-schema#268 to rails application.

@tadeboro
Copy link
Contributor Author

tadeboro commented Sep 4, 2018

@miq-bot assign @agrare

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.

Just one change then this looks good


has_many :event_streams, :inverse_of => :physical_chassis, :dependent => :nullify
has_many :physical_servers, :dependent => :destroy, :inverse_of => :physical_chassis
has_many :physical_storages, :dependent => :destroy, :inverse_of => :physical_chassis
has_many :physical_chassis,
Copy link
Member

Choose a reason for hiding this comment

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

Think this should be child_physical_chassis

@tadeboro
Copy link
Contributor Author

@agrare I updated the relationships as suggested.


has_many :event_streams, :inverse_of => :physical_chassis, :dependent => :nullify
has_many :physical_servers, :dependent => :destroy, :inverse_of => :physical_chassis
has_many :physical_storages, :dependent => :destroy, :inverse_of => :physical_chassis
has_many :child_physical_chassis,
:class_name => "PhysicalChassis",
:dependent => :destroy,
Copy link
Member

Choose a reason for hiding this comment

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

@tadeboro this should probably be :dependent => :nullify since the child chassis will have their own ems_id+ems_ref and thus should be deleted by ems_refresh.
E.g. what if the child chassis were removed from the parent chassis and the parent was deleted but the children were still around.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I never thought about this, since in Redfish world, removing intermediary chassis would be so disruptive, that most (if not all) ems_refs would change. But you are correct, reparenting/deleting should be handled by refresh process. Will fix this.

This commit exposes database schema changes to rails application.
@miq-bot
Copy link
Member

miq-bot commented Sep 10, 2018

Checked commit xlab-si@b43d61e with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
1 file checked, 0 offenses detected
Everything looks fine. 👍

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 17cf9b6 into ManageIQ:master Sep 10, 2018
@agrare agrare added this to the Sprint 94 Ending Sept 10, 2018 milestone Sep 10, 2018
@tadeboro tadeboro deleted the physical-chassis-hierarchy branch September 10, 2018 19:02
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.

3 participants