Code improvement in type_vxlan.py and type_gre.py files
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
This commit is contained in:
parent
6df7f5abf1
commit
d580f78a0e
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user