-
Notifications
You must be signed in to change notification settings - Fork 896
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
[WIP] Extract NetworkManager parent_manager to a mixin #20229
[WIP] Extract NetworkManager parent_manager to a mixin #20229
Conversation
9f3214c
to
1c3ee1a
Compare
9bbfa4f
to
2d8f6d1
Compare
2d8f6d1
to
4e4472e
Compare
@gtanzillo @lpichler question (re: #18504), the Is there a way to get this |
Extract the logic for a NetworkManager belonging to a CloudManager parent out of the base NetworkManager class and move it to a mixin.
4e4472e
to
e01e164
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.
Really like the factory changes.
Don't see where you are mixing this into NetworkManager
(yes, WIP...)
These methods are white noise.
Wish we could delete them rather than hiding them behind a mixin.
virtual_total :total_vms_and_templates, :vms_and_templates | ||
|
||
# Relationships delegated to parent manager | ||
virtual_delegate :orchestration_stacks, |
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.
different PR:
would be nice if we used has_many :through
instead.
Though, that will not work for virtual relationships on the manager model
Checked commits agrare/manageiq@e01e164~...832ac8a with ruby 2.5.7, rubocop 0.69.0, haml-lint 0.28.0, and yamllint app/models/manageiq/providers/network_manager.rb
app/models/mixins/belongs_to_parent_manager_mixin.rb
|
Yeah I'm considering pulling just those out into its own PR since nuage and nsx-t having a parent manager isn't accurate even without this mixin
That's actually done in the provider PRs |
Extract the logic for a NetworkManager belonging to a CloudManager parent out of the base NetworkManager class and move it to a mixin. This allows for the standard logic for deciding if a manager can be created directly to be used (aka does it have a belongs_to :parent_manager reflection) for the standalone network providers like Nuage and NSX-t.
Dependents:
Cross Repo Tests: ManageIQ/manageiq-cross_repo-tests#136