Mergin fix for Bug 818321
Thanks lp:danwent !
This commit is contained in:
commit
6084fd93f4
@ -50,12 +50,8 @@ class ViewBuilder(object):
|
|||||||
|
|
||||||
def _build_detail(self, network_data):
|
def _build_detail(self, network_data):
|
||||||
"""Return a detailed model of a network."""
|
"""Return a detailed model of a network."""
|
||||||
# net-ports might not be present in response from plugin
|
|
||||||
ports = network_data.get('net-ports', None)
|
|
||||||
portcount = ports and len(ports) or 0
|
|
||||||
return dict(network=dict(id=network_data['net-id'],
|
return dict(network=dict(id=network_data['net-id'],
|
||||||
name=network_data['net-name'],
|
name=network_data['net-name']))
|
||||||
PortCount=portcount))
|
|
||||||
|
|
||||||
def _build_port(self, port_data):
|
def _build_port(self, port_data):
|
||||||
"""Return details about a specific logical port."""
|
"""Return details about a specific logical port."""
|
||||||
|
@ -114,8 +114,7 @@ class APITest(unittest.TestCase):
|
|||||||
network_data = self._net_serializer.deserialize(
|
network_data = self._net_serializer.deserialize(
|
||||||
show_network_res.body, content_type)
|
show_network_res.body, content_type)
|
||||||
self.assertEqual({'id': network_id,
|
self.assertEqual({'id': network_id,
|
||||||
'name': self.network_name,
|
'name': self.network_name},
|
||||||
'PortCount': 0},
|
|
||||||
network_data['network'])
|
network_data['network'])
|
||||||
LOG.debug("_test_show_network - format:%s - END", format)
|
LOG.debug("_test_show_network - format:%s - END", format)
|
||||||
|
|
||||||
@ -147,8 +146,7 @@ class APITest(unittest.TestCase):
|
|||||||
network_data = self._net_serializer.deserialize(
|
network_data = self._net_serializer.deserialize(
|
||||||
show_network_res.body, content_type)
|
show_network_res.body, content_type)
|
||||||
self.assertEqual({'id': network_id,
|
self.assertEqual({'id': network_id,
|
||||||
'name': new_name,
|
'name': new_name},
|
||||||
'PortCount': 0},
|
|
||||||
network_data['network'])
|
network_data['network'])
|
||||||
LOG.debug("_test_rename_network - format:%s - END", format)
|
LOG.debug("_test_rename_network - format:%s - END", format)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user