summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarath Kumar <sarath.kutty@bigswitch.com>2017-05-25 16:06:42 -0700
committerAditya Vaja <wolverine.av@gmail.com>2017-05-30 15:13:27 +0000
commitbd8686933a18459f08ae2063fbd127689b8000b3 (patch)
tree4d56ce613a417d47b9401866362bbfac67a7004e
parent257ebd63f36d14eb50313943b0db5d894a71ee10 (diff)
cleanup: move function call debug log msg into decorator
Notes
Notes (review): Code-Review+1: Joe Mills <joe.h.mills@gmail.com> Code-Review+2: Aditya Vaja <wolverine.av@gmail.com> Workflow+1: Sarath Kumar Sankaran Kutty <sarath.kutty@bigswitch.com> Code-Review+2: Sarath Kumar Sankaran Kutty <sarath.kutty@bigswitch.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Tue, 30 May 2017 15:33:02 +0000 Reviewed-on: https://review.openstack.org/468200 Project: openstack/networking-bigswitch Branch: refs/heads/stable/newton
-rw-r--r--networking_bigswitch/plugins/bigswitch/plugin.py18
-rw-r--r--networking_bigswitch/plugins/ml2/drivers/mech_bigswitch/driver.py1
2 files changed, 2 insertions, 17 deletions
diff --git a/networking_bigswitch/plugins/bigswitch/plugin.py b/networking_bigswitch/plugins/bigswitch/plugin.py
index 0a050ec..a9a4885 100644
--- a/networking_bigswitch/plugins/bigswitch/plugin.py
+++ b/networking_bigswitch/plugins/bigswitch/plugin.py
@@ -855,6 +855,7 @@ def put_context_in_serverpool(f):
855 def wrapper(self, context, *args, **kwargs): 855 def wrapper(self, context, *args, **kwargs):
856 # core plugin: context is top level object 856 # core plugin: context is top level object
857 # ml2: keeps context in _plugin_context 857 # ml2: keeps context in _plugin_context
858 LOG.debug("Function: %(fname)s called", {'fname': f.__name__})
858 self.servers.set_context(getattr(context, '_plugin_context', context)) 859 self.servers.set_context(getattr(context, '_plugin_context', context))
859 return f(self, context, *args, **kwargs) 860 return f(self, context, *args, **kwargs)
860 return wrapper 861 return wrapper
@@ -954,8 +955,6 @@ class NeutronRestProxyV2(NeutronRestProxyV2Base,
954 955
955 :raises: RemoteRestError 956 :raises: RemoteRestError
956 """ 957 """
957 LOG.debug("NeutronRestProxyV2: create_network() called")
958
959 self._warn_on_state_status(network['network']) 958 self._warn_on_state_status(network['network'])
960 959
961 with context.session.begin(subtransactions=True): 960 with context.session.begin(subtransactions=True):
@@ -997,8 +996,6 @@ class NeutronRestProxyV2(NeutronRestProxyV2Base,
997 :raises: exceptions.NetworkNotFound 996 :raises: exceptions.NetworkNotFound
998 :raises: RemoteRestError 997 :raises: RemoteRestError
999 """ 998 """
1000 LOG.debug("NeutronRestProxyV2.update_network() called")
1001
1002 self._warn_on_state_status(network['network']) 999 self._warn_on_state_status(network['network'])
1003 1000
1004 session = context.session 1001 session = context.session
@@ -1025,8 +1022,6 @@ class NeutronRestProxyV2(NeutronRestProxyV2Base,
1025 :raises: exceptions.NetworkNotFound 1022 :raises: exceptions.NetworkNotFound
1026 :raises: RemoteRestError 1023 :raises: RemoteRestError
1027 """ 1024 """
1028 LOG.debug("NeutronRestProxyV2: delete_network() called")
1029
1030 # Validate args 1025 # Validate args
1031 orig_net = super(NeutronRestProxyV2, self).get_network(context, net_id) 1026 orig_net = super(NeutronRestProxyV2, self).get_network(context, net_id)
1032 with context.session.begin(subtransactions=True): 1027 with context.session.begin(subtransactions=True):
@@ -1063,8 +1058,6 @@ class NeutronRestProxyV2(NeutronRestProxyV2Base,
1063 :raises: exceptions.StateInvalid 1058 :raises: exceptions.StateInvalid
1064 :raises: RemoteRestError 1059 :raises: RemoteRestError
1065 """ 1060 """
1066 LOG.debug("NeutronRestProxyV2: create_port() called")
1067
1068 # Update DB in new session so exceptions rollback changes 1061 # Update DB in new session so exceptions rollback changes
1069 with context.session.begin(subtransactions=True): 1062 with context.session.begin(subtransactions=True):
1070 self._ensure_default_security_group_on_port(context, port) 1063 self._ensure_default_security_group_on_port(context, port)
@@ -1156,8 +1149,6 @@ class NeutronRestProxyV2(NeutronRestProxyV2Base,
1156 :raises: exceptions.PortNotFound 1149 :raises: exceptions.PortNotFound
1157 :raises: RemoteRestError 1150 :raises: RemoteRestError
1158 """ 1151 """
1159 LOG.debug("NeutronRestProxyV2: update_port() called")
1160
1161 self._warn_on_state_status(port['port']) 1152 self._warn_on_state_status(port['port'])
1162 1153
1163 # Validate Args 1154 # Validate Args
@@ -1220,8 +1211,6 @@ class NeutronRestProxyV2(NeutronRestProxyV2Base,
1220 :raises: exceptions.NetworkNotFound 1211 :raises: exceptions.NetworkNotFound
1221 :raises: RemoteRestError 1212 :raises: RemoteRestError
1222 """ 1213 """
1223 LOG.debug("NeutronRestProxyV2: delete_port() called")
1224
1225 # if needed, check to see if this is a port owned by 1214 # if needed, check to see if this is a port owned by
1226 # and l3-router. If so, we should prevent deletion. 1215 # and l3-router. If so, we should prevent deletion.
1227 if l3_port_check and self.l3_plugin: 1216 if l3_port_check and self.l3_plugin:
@@ -1243,8 +1232,6 @@ class NeutronRestProxyV2(NeutronRestProxyV2Base,
1243 1232
1244 @put_context_in_serverpool 1233 @put_context_in_serverpool
1245 def create_subnet(self, context, subnet): 1234 def create_subnet(self, context, subnet):
1246 LOG.debug("NeutronRestProxyV2: create_subnet() called")
1247
1248 self._warn_on_state_status(subnet['subnet']) 1235 self._warn_on_state_status(subnet['subnet'])
1249 1236
1250 with context.session.begin(subtransactions=True): 1237 with context.session.begin(subtransactions=True):
@@ -1260,8 +1247,6 @@ class NeutronRestProxyV2(NeutronRestProxyV2Base,
1260 1247
1261 @put_context_in_serverpool 1248 @put_context_in_serverpool
1262 def update_subnet(self, context, id, subnet): 1249 def update_subnet(self, context, id, subnet):
1263 LOG.debug("NeutronRestProxyV2: update_subnet() called")
1264
1265 self._warn_on_state_status(subnet['subnet']) 1250 self._warn_on_state_status(subnet['subnet'])
1266 1251
1267 with context.session.begin(subtransactions=True): 1252 with context.session.begin(subtransactions=True):
@@ -1277,7 +1262,6 @@ class NeutronRestProxyV2(NeutronRestProxyV2Base,
1277 1262
1278 @put_context_in_serverpool 1263 @put_context_in_serverpool
1279 def delete_subnet(self, context, id): 1264 def delete_subnet(self, context, id):
1280 LOG.debug("NeutronRestProxyV2: delete_subnet() called")
1281 orig_subnet = super(NeutronRestProxyV2, self).get_subnet(context, id) 1265 orig_subnet = super(NeutronRestProxyV2, self).get_subnet(context, id)
1282 net_id = orig_subnet['network_id'] 1266 net_id = orig_subnet['network_id']
1283 with context.session.begin(subtransactions=True): 1267 with context.session.begin(subtransactions=True):
diff --git a/networking_bigswitch/plugins/ml2/drivers/mech_bigswitch/driver.py b/networking_bigswitch/plugins/ml2/drivers/mech_bigswitch/driver.py
index 8ee0932..803fe52 100644
--- a/networking_bigswitch/plugins/ml2/drivers/mech_bigswitch/driver.py
+++ b/networking_bigswitch/plugins/ml2/drivers/mech_bigswitch/driver.py
@@ -439,6 +439,7 @@ class BigSwitchMechanismDriver(plugin.NeutronRestProxyV2Base,
439 } 439 }
440 context.set_binding(segment[api.ID], vif_type, vif_details) 440 context.set_binding(segment[api.ID], vif_type, vif_details)
441 441
442 @put_context_in_serverpool
442 def bind_port(self, context): 443 def bind_port(self, context):
443 """Marks ports as bound. 444 """Marks ports as bound.
444 445