From f1e464d9e6c2e61516c7ef3cf6363dd04a7aa6aa Mon Sep 17 00:00:00 2001 From: Salvatore Orlando Date: Tue, 23 Aug 2011 00:57:33 +0100 Subject: [PATCH] Fixing issue in view builders concerning attachment identifiers --- quantum/api/views/attachments.py | 4 ++-- quantum/api/views/networks.py | 4 ++-- quantum/api/views/ports.py | 4 ++-- quantum/plugins/SamplePlugin.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) 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): -- 2.45.2