-
Notifications
You must be signed in to change notification settings - Fork 898
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
Conversation
f7b0043
to
fb7ffbf
Compare
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.
Just one change then this looks good
app/models/physical_chassis.rb
Outdated
|
||
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, |
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.
Think this should be child_physical_chassis
dd1aa4e
to
0c36e88
Compare
@agrare I updated the relationships as suggested. |
app/models/physical_chassis.rb
Outdated
|
||
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, |
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.
@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.
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.
I never thought about this, since in Redfish world, removing intermediary chassis would be so disruptive, that most (if not all) ems_ref
s 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.
0c36e88
to
b43d61e
Compare
Checked commit xlab-si@b43d61e with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
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
This commit exposes database schema changes from ManageIQ/manageiq-schema#268 to rails application.