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

Relate FloatingIp to NetworkRouter #113

Merged
merged 1 commit into from
Jul 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ def floating_ips
persister.floating_ips.find_or_build(ip['ID']).assign_attributes(
:address => ip['address'],
:cloud_network => persister.cloud_networks.lazy_find(ip['associatedSharedNetworkResourceID']),
# TODO(miha-plesko): uncomment when https://github.com/ManageIQ/manageiq-schema/pull/217 is merged
# :network_router => persister.network_routers.lazy_find(ip['parentID']),
:network_router => persister.network_routers.lazy_find(ip['parentID']),
:cloud_tenant => persister.network_routers.lazy_find(ip['parentID'], :key => :cloud_tenant)
)
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
class ManageIQ::Providers::Nuage::NetworkManager::NetworkRouter < ::NetworkRouter
has_many :floating_ips, :dependent => :destroy

# TODO(miha-plesko): remove when https://github.com/ManageIQ/manageiq-schema/pull/217 is merged
def floating_ips
FloatingIp.none
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,9 @@ def assert_floating_ips
:cloud_tenant_id => CloudTenant.find_by(:ems_ref => tenant_ref2).id,
:type => 'ManageIQ::Providers::Nuage::NetworkManager::FloatingIp'
)
# TODO(miha-plesko): uncomment when https://github.com/ManageIQ/manageiq-schema/pull/217 is merged
# expect(NetworkRouter.find_by(:ems_ref => router_ref).floating_ips).to include(ip)
router = NetworkRouter.find_by(:ems_ref => router_ref)
expect(ip.network_router).to eq(router)
expect(router.floating_ips).to include(ip)
end

def assert_cloud_networks
Expand Down