Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def post_link_event(self, linktuple, action):
e = Link_event(create_datapathid_from_host(linktuple[0]),
create_datapathid_from_host(linktuple[2]),
linktuple[1], linktuple[3], action)
self.post(e)
def post_link_event(self, linktuple, action):
e = Link_event(create_datapathid_from_host(linktuple[0]),
create_datapathid_from_host(linktuple[2]),
linktuple[1], linktuple[3], action)
self.post(e)
def add_link(self, linktuple):
self.post_link_event(linktuple, Link_event.ADD)
src_dpid = create_datapathid_from_host(linktuple[0])
src_port = linktuple[1]
dst_dpid = create_datapathid_from_host(linktuple[2])
dst_port = linktuple[3]
self._bindings.add_link(src_dpid,src_port,dst_dpid,dst_port)
self._user_event_log.log("discovery",LogLevel.ALERT,
"Added network link between {sl} and {dl}",
set_src_loc = (src_dpid,src_port),
set_dst_loc = (dst_dpid,dst_port))
def post_link_event(self, linktuple, action):
e = Link_event(create_datapathid_from_host(linktuple[0]),
create_datapathid_from_host(linktuple[2]),
linktuple[1], linktuple[3], action)
self.post(e)
def delete_links(self, deleteme):
for linktuple in deleteme:
del self.adjacency_list[linktuple]
src_dpid = create_datapathid_from_host(linktuple[0])
src_port = linktuple[1]
dst_dpid = create_datapathid_from_host(linktuple[2])
dst_port = linktuple[3]
try:
self._bindings.remove_link(src_dpid,src_port,dst_dpid,dst_port)
self._user_event_log.log("discovery",LogLevel.ALERT,
"Removed network link between {sl} and {dl}",
set_src_loc = (src_dpid,src_port),
set_dst_loc = (dst_dpid,dst_port))
except Exception, e:
lg.error('Error removing links from binding storage')
self.post_link_event(linktuple, Link_event.REMOVE)
def delete_links(self, deleteme):
for linktuple in deleteme:
del self.adjacency_list[linktuple]
src_dpid = create_datapathid_from_host(linktuple[0])
src_port = linktuple[1]
dst_dpid = create_datapathid_from_host(linktuple[2])
dst_port = linktuple[3]
try:
self._bindings.remove_link(src_dpid,src_port,dst_dpid,dst_port)
self._user_event_log.log("discovery",LogLevel.ALERT,
"Removed network link between {sl} and {dl}",
set_src_loc = (src_dpid,src_port),
set_dst_loc = (dst_dpid,dst_port))
except Exception, e:
lg.error('Error removing links from binding storage')
self.post_link_event(linktuple, Link_event.REMOVE)
def post_link_event(self, linktuple, action):
e = Link_event(create_datapathid_from_host(linktuple[0]),
create_datapathid_from_host(linktuple[2]),
linktuple[1], linktuple[3], action)
self.post(e)
def delete_links(self, deleteme):
for linktuple in deleteme:
del self.adjacency_list[linktuple]
src_dpid = create_datapathid_from_host(linktuple[0])
src_port = linktuple[1]
dst_dpid = create_datapathid_from_host(linktuple[2])
dst_port = linktuple[3]
try:
self._bindings.remove_link(src_dpid,src_port,dst_dpid,dst_port)
self._user_event_log.log("discovery",LogLevel.ALERT,
"Removed network link between {sl} and {dl}",
set_src_loc = (src_dpid,src_port),
set_dst_loc = (dst_dpid,dst_port))
except Exception, e:
lg.error('Error removing links from binding storage')
self.post_link_event(linktuple, Link_event.REMOVE)