Skip to content

Commit

Permalink
Show CloudTenants in network manager's topology view
Browse files Browse the repository at this point in the history
With this commit we let NetworkManager's topology view render
CloudTenants with basic entities beneath them in order for Nuage
provider to display a meaningful topology view.

Since Nuage provider subclasses CloudSubnets into

```
ManageIQ::Providers::Nuage::NetworkManager::CloudSubnet::L2
ManageIQ::Providers::Nuage::NetworkManager::CloudSubnet::L3
```

we also make sure those get appropriate class name assigned
(i.e. base class name).

Signed-off-by: Miha Pleško <[email protected]>
  • Loading branch information
miha-plesko committed Aug 30, 2018
1 parent 2cddff2 commit 34672dc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/services/network_topology_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,23 @@ class NetworkTopologyService < TopologyService
:floating_ips => :writable_classification_tags
]
]
],
:cloud_tenants => [
:network_routers => [
:floating_ips,
:security_groups,
:cloud_subnets
],
:cloud_subnets => [
:security_groups
]
]
]

@kinds = %i(NetworkRouter CloudSubnet Vm NetworkManager FloatingIp CloudNetwork NetworkPort CloudTenant SecurityGroup LoadBalancer Tag AvailabilityZone)

def entity_type(entity)
if entity.kind_of?(CloudNetwork)
if entity.kind_of?(CloudNetwork) || entity.kind_of?(CloudSubnet)
entity.class.base_class.name.demodulize
else
super
Expand Down

0 comments on commit 34672dc

Please sign in to comment.