From eb6182fa6192b1ae4268ac02583622978d449a09 Mon Sep 17 00:00:00 2001 From: Kanzhe Jiang Date: Fri, 17 May 2013 14:35:29 -0700 Subject: [PATCH] Add l3 attribute to network The fix is to add l3 attribute(s) to the returned objects in get_network() and get_networks() Fixes: bug #1180971 Change-Id: I4b9c932fae90a169ad1c0119f45e90a2ee260acd --- quantum/plugins/bigswitch/plugin.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/quantum/plugins/bigswitch/plugin.py b/quantum/plugins/bigswitch/plugin.py index 4d9a5eefc..447725087 100644 --- a/quantum/plugins/bigswitch/plugin.py +++ b/quantum/plugins/bigswitch/plugin.py @@ -486,6 +486,27 @@ class QuantumRestProxyV2(db_base_plugin_v2.QuantumDbPluginV2, "network: %s"), e.message) raise + def get_network(self, context, id, fields=None): + session = context.session + with session.begin(subtransactions=True): + net = super(QuantumRestProxyV2, self).get_network(context, + id, None) + self._extend_network_dict_l3(context, net) + return self._fields(net, fields) + + def get_networks(self, context, filters=None, fields=None, + sorts=None, + limit=None, marker=None, page_reverse=False): + session = context.session + with session.begin(subtransactions=True): + nets = super(QuantumRestProxyV2, + self).get_networks(context, filters, None, sorts, + limit, marker, page_reverse) + for net in nets: + self._extend_network_dict_l3(context, net) + + return [self._fields(net, fields) for net in nets] + def create_port(self, context, port): """Create a port, which is a connection point of a device (e.g., a VM NIC) to attach to a L2 Quantum network. -- 2.45.2