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

model for add/remove interface on network router #13032

Merged
merged 1 commit into from
Dec 22, 2016

Conversation

sseago
Copy link
Contributor

@sseago sseago commented Dec 7, 2016

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

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
@miq-bot
Copy link
Member

miq-bot commented Dec 7, 2016

Checked commit sseago@4db629b with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1
7 files checked, 3 offenses detected

app/models/manageiq/providers/openstack/network_manager/network_router.rb

  • ❕ - Line 107, Col 3 - Metrics/AbcSize - Assignment Branch Condition size for remove_interface is too high. [20.32/20]
  • ❕ - Line 77, Col 3 - Metrics/AbcSize - Assignment Branch Condition size for add_interface is too high. [20.32/20]

spec/lib/miq_automation_engine/service_methods/miq_ae_service_manageiq-providers-openstack-network_manager-network_router_spec.rb

@tzumainn
Copy link
Contributor

tzumainn commented Dec 8, 2016

👍 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.

@tzumainn
Copy link
Contributor

tzumainn commented Dec 8, 2016

@miq-bot assign @chessbyte

@miq-bot miq-bot assigned chessbyte and unassigned tzumainn Dec 8, 2016
@sseago
Copy link
Contributor Author

sseago commented Dec 8, 2016

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)

@chessbyte chessbyte assigned blomquisg and unassigned chessbyte Dec 8, 2016
@@ -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
Copy link
Member

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?

Copy link
Contributor Author

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.

Copy link
Member

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 ✂️ .

Copy link
Contributor Author

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.

@blomquisg
Copy link
Member

I'm generally good with this ... One question for @gmcculloug

@tzumainn
Copy link
Contributor

@miq-bot add_label euwe/yes
@miq-bot add_label bug
@miq-bot add_label blocker

@blomquisg blomquisg merged commit c2bf396 into ManageIQ:master Dec 22, 2016
@blomquisg blomquisg added this to the Sprint 51 Ending Jan 2, 2017 milestone Dec 22, 2016
@sseago
Copy link
Contributor Author

sseago commented Jan 15, 2017

@blomquisg This one still needs to be backported to euwe before my UI backport PR will work.

simaishi pushed a commit that referenced this pull request Jan 16, 2017
model for add/remove interface on network router
(cherry picked from commit c2bf396)

https://bugzilla.redhat.com/show_bug.cgi?id=1413212
@simaishi
Copy link
Contributor

Euwe backport details:

$ git log -1
commit 98d8e34d887592e091a8ba009f0c79df171bf5bb
Author: Greg Blomquist <blomquisg@gmail.com>
Date:   Thu Dec 22 13:41:35 2016 -0500

    Merge pull request #13032 from sseago/router-interfaces-model
    
    model for add/remove interface on network router
    (cherry picked from commit c2bf3960cc213e5d8baeff16fa423936931e27b6)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1413212

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.

7 participants