-
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
model for add/remove interface on network router #13032
Conversation
This commit adds model code for adding and removing router interfaces. BZ for this is: https://bugzilla.redhat.com/show_bug.cgi?id=1394284 Euwe backport depends on merging ManageIQ#13005
6c7b462
to
4db629b
Compare
Checked commit sseago@4db629b with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 app/models/manageiq/providers/openstack/network_manager/network_router.rb
spec/lib/miq_automation_engine/service_methods/miq_ae_service_manageiq-providers-openstack-network_manager-network_router_spec.rb
|
👍 looks good to me. The only question I might have is whether we should use the raw_ method pattern, but I could see the argument that it's more important to make this update consistent with the rest of the model, and save the refactoring for a non-BZ fix. |
@miq-bot assign @chessbyte |
Yeah, the move back to the raw_ pattern was mentioned on a prior feature. Since this was just adding two new operations to the existing CRUD operations, it seemed out-of-place to do it differently for just two operations. If/when we refactor this to use the raw_ pattern, it needs to be done on the basic CRUD operations at the same time -- if we have some refactoring sprint set for a non-BZ release, it might be more appropriate there (and there are several other models to make this same change) |
@@ -8,8 +8,5 @@ class MiqAeServiceNetworkRouter < MiqAeServiceModelBase | |||
expose :network_ports, :association => true | |||
expose :vms, :association => true | |||
expose :private_networks, :association => true | |||
|
|||
expose :raw_update_network_router | |||
expose :raw_delete_network_router |
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.
@gmcculloug any issues with removing these? I only ask because un-exposing methods might be tricky ...
I wonder if there's a deprecation model in Automate?
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.
@blomquisg In this case I removed them because the underlying methods are no longer there. When I was adding the new methods for this PR I realized that a prior change had removed these two without removing the expose calls.
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.
Did these methods ever exist in the active_record models? They do not exist on the commit that introduced the service_model methods (060254c) and the tests are only checking that the service model contains the method.
Also git log -S "raw_update_network_router"
only references the commit above. So I'm guessing these were never usable in the first place. So ✂️ .
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.
@gmcculloug So if they were never in the history, I suspect it was a refactoring of the initial commit/PR before it was merged that somehow forgot to refactor the automate bits.
I'm generally good with this ... One question for @gmcculloug |
@blomquisg This one still needs to be backported to euwe before my UI backport PR will work. |
model for add/remove interface on network router (cherry picked from commit c2bf396) https://bugzilla.redhat.com/show_bug.cgi?id=1413212
Euwe backport details:
|
This PR adds model code for adding and removing router interfaces.
BZ for this is:
https://bugzilla.redhat.com/show_bug.cgi?id=1394284
Euwe backport depends on merging #13005