Merge "Code improvement in type_vxlan.py and type_gre.py files"
This commit is contained in:
commit
ce7b4f4005
@ -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…
Reference in New Issue
Block a user