From 719eb42a973baa18664cc2cc853807de9098bf81 Mon Sep 17 00:00:00 2001 From: Dan Wendlandt Date: Sun, 31 Jul 2011 11:53:36 -0700 Subject: [PATCH] remove PortCount attribute of network object, as it is not in the spec and was causing us to hit bug 818321 (note: this commit does not fix the underlyingproblem with xml deserialization, it just makes sure we don't hit it with the existing API code) --- quantum/api/views/networks.py | 3 +-- tests/unit/test_api.py | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/quantum/api/views/networks.py b/quantum/api/views/networks.py index 2242e00f79..393725915a 100644 --- a/quantum/api/views/networks.py +++ b/quantum/api/views/networks.py @@ -54,8 +54,7 @@ class ViewBuilder(object): ports = network_data.get('net-ports', None) portcount = ports and len(ports) or 0 return dict(network=dict(id=network_data['net-id'], - name=network_data['net-name'], - PortCount=portcount)) + name=network_data['net-name'])) def _build_port(self, port_data): """Return details about a specific logical port.""" diff --git a/tests/unit/test_api.py b/tests/unit/test_api.py index d17e6ed87f..a442ad1df9 100644 --- a/tests/unit/test_api.py +++ b/tests/unit/test_api.py @@ -114,8 +114,7 @@ class APITest(unittest.TestCase): network_data = self._net_serializer.deserialize( show_network_res.body, content_type) self.assertEqual({'id': network_id, - 'name': self.network_name, - 'PortCount': 0}, + 'name': self.network_name}, network_data['network']) LOG.debug("_test_show_network - format:%s - END", format) @@ -147,8 +146,7 @@ class APITest(unittest.TestCase): network_data = self._net_serializer.deserialize( show_network_res.body, content_type) self.assertEqual({'id': network_id, - 'name': new_name, - 'PortCount': 0}, + 'name': new_name}, network_data['network']) LOG.debug("_test_rename_network - format:%s - END", format)