if 'lswitch-display-name' not in result:
raise exception.NetworkNotFound(net_id=id)
+ # Fetch network in quantum
+ quantum_db = super(NvpPluginV2, self).get_network(context, id, fields)
d = {'id': id,
'name': result['lswitch-display-name'],
'tenant_id': network['tenant_id'],
'admin_state_up': True,
'status': constants.NET_STATUS_ACTIVE,
'shared': network['shared'],
- 'subnets': []}
+ 'subnets': quantum_db.get('subnets', [])}
LOG.debug("get_network() completed for tenant %s: %s" % (
context.tenant_id, d))
self.assertEquals(res['network']['name'],
net['network']['name'])
+ def test_show_network_with_subnet(self):
+ with self.network(name='net1') as net:
+ with self.subnet(net) as subnet:
+ req = self.new_show_request('networks', net['network']['id'])
+ res = self.deserialize('json', req.get_response(self.api))
+ self.assertEquals(res['network']['subnets'][0],
+ subnet['subnet']['id'])
+
def test_invalid_admin_status(self):
fmt = 'json'
value = [[7, False, 400], [True, True, 201], ["True", True, 201],