]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Code improvement in type_vxlan.py and type_gre.py files
authorAman Kumar <amank@hp.com>
Fri, 9 Jan 2015 09:16:59 +0000 (01:16 -0800)
committerRomil Gupta <romilg@hp.com>
Mon, 12 Jan 2015 12:19:04 +0000 (12:19 +0000)
This patch set basically addressing the review comment
given in the following patch-set:
https://review.openstack.org/#/c/121000/

Co-Authored-By: Romil Gupta <romilg@hp.com>
Change-Id: I12cbb4737e4938b8da808cb19f5e9d1e290f2559

neutron/plugins/ml2/drivers/type_gre.py
neutron/plugins/ml2/drivers/type_vxlan.py

index 076bd2b2699e4f5a386df40f4d0e1d6769a6ac6d..96a6715eb57d03913a8aef2cf3d7babbad280a19 100644 (file)
@@ -128,18 +128,14 @@ class GreTypeDriver(type_tunnel.TunnelTypeDriver):
     def get_endpoint_by_host(self, host):
         LOG.debug("get_endpoint_by_host() called for host %s", host)
         session = db_api.get_session()
-
-        host_endpoint = (session.query(GreEndpoints).
-                         filter_by(host=host).first())
-        return host_endpoint
+        return (session.query(GreEndpoints).
+                filter_by(host=host).first())
 
     def get_endpoint_by_ip(self, ip):
         LOG.debug("get_endpoint_by_ip() called for ip %s", ip)
         session = db_api.get_session()
-
-        ip_endpoint = (session.query(GreEndpoints).
-                       filter_by(ip_address=ip).first())
-        return ip_endpoint
+        return (session.query(GreEndpoints).
+                filter_by(ip_address=ip).first())
 
     def add_endpoint(self, ip, host):
         LOG.debug("add_gre_endpoint() called for ip %s", ip)
index 5c38d63eb07ee460cfbf3222b9aeeb80fb0f1aad..563179de1967d152682d9b4666fdac46ce8dd108 100644 (file)
@@ -146,18 +146,14 @@ class VxlanTypeDriver(type_tunnel.TunnelTypeDriver):
     def get_endpoint_by_host(self, host):
         LOG.debug("get_endpoint_by_host() called for host %s", host)
         session = db_api.get_session()
-
-        host_endpoint = (session.query(VxlanEndpoints).
-                         filter_by(host=host).first())
-        return host_endpoint
+        return (session.query(VxlanEndpoints).
+                filter_by(host=host).first())
 
     def get_endpoint_by_ip(self, ip):
         LOG.debug("get_endpoint_by_ip() called for ip %s", ip)
         session = db_api.get_session()
-
-        ip_endpoint = (session.query(VxlanEndpoints).
-                       filter_by(ip_address=ip).first())
-        return ip_endpoint
+        return (session.query(VxlanEndpoints).
+                filter_by(ip_address=ip).first())
 
     def add_endpoint(self, ip, host, udp_port=VXLAN_UDP_PORT):
         LOG.debug("add_vxlan_endpoint() called for ip %s", ip)