From: Salvatore Orlando Date: Mon, 22 Aug 2011 23:57:33 +0000 (+0100) Subject: Fixing issue in view builders concerning attachment identifiers X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=f1e464d9e6c2e61516c7ef3cf6363dd04a7aa6aa;p=openstack-build%2Fneutron-build.git Fixing issue in view builders concerning attachment identifiers --- diff --git a/quantum/api/views/attachments.py b/quantum/api/views/attachments.py index 955495889..31351a1e0 100644 --- a/quantum/api/views/attachments.py +++ b/quantum/api/views/attachments.py @@ -31,7 +31,7 @@ class ViewBuilder(object): def build(self, attachment_data): """Generic method used to generate an attachment entity.""" - if attachment_data['attachment-id']: - return dict(attachment=dict(id=attachment_data['attachment-id'])) + if attachment_data['attachment']: + return dict(attachment=dict(id=attachment_data['attachment'])) else: return dict(attachment={}) diff --git a/quantum/api/views/networks.py b/quantum/api/views/networks.py index 5efb425ea..4b2e77df2 100644 --- a/quantum/api/views/networks.py +++ b/quantum/api/views/networks.py @@ -54,6 +54,6 @@ class ViewBuilder(object): """Return details about a specific logical port.""" port_dict = dict(id=port_data['port-id'], state=port_data['port-state']) - if port_data['attachment-id']: - port_dict['attachment'] = dict(id=port_data['attachment-id']) + if port_data['attachment']: + port_dict['attachment'] = dict(id=port_data['attachment']) return port_dict diff --git a/quantum/api/views/ports.py b/quantum/api/views/ports.py index f7b75e41a..164726eb3 100644 --- a/quantum/api/views/ports.py +++ b/quantum/api/views/ports.py @@ -34,6 +34,6 @@ class ViewBuilder(object): port = dict(port=dict(id=port_data['port-id'])) if port_details: port['port']['state'] = port_data['port-state'] - if att_details and port_data['attachment-id']: - port['port']['attachment'] = dict(id=port_data['attachment-id']) + if att_details and port_data['attachment']: + port['port']['attachment'] = dict(id=port_data['attachment']) return port diff --git a/quantum/plugins/SamplePlugin.py b/quantum/plugins/SamplePlugin.py index 1924c1159..27dba1f3a 100644 --- a/quantum/plugins/SamplePlugin.py +++ b/quantum/plugins/SamplePlugin.py @@ -352,7 +352,7 @@ class FakePlugin(object): LOG.debug("FakePlugin.get_port_details() called") port = self._get_port(tenant_id, net_id, port_id) return {'port-id': str(port.uuid), - 'attachment-id': port.interface_id, + 'attachment': port.interface_id, 'port-state': port.state} def create_port(self, tenant_id, net_id, port_state=None):