本文整理汇总了Python中empower.main.RUNTIME.remove_lvap方法的典型用法代码示例。如果您正苦于以下问题:Python RUNTIME.remove_lvap方法的具体用法?Python RUNTIME.remove_lvap怎么用?Python RUNTIME.remove_lvap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类empower.main.RUNTIME
的用法示例。
在下文中一共展示了RUNTIME.remove_lvap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _on_disconnect
# 需要导入模块: from empower.main import RUNTIME [as 别名]
# 或者: from empower.main.RUNTIME import remove_lvap [as 别名]
def _on_disconnect(self):
""" Handle WTP disconnection """
if not self.wtp:
return
LOG.info("WTP disconnected: %s", self.wtp.addr)
# remove hosted lvaps
for addr in list(RUNTIME.lvaps.keys()):
lvap = RUNTIME.lvaps[addr]
dl_wtps = [block.radio for block in lvap.downlink.keys()]
ul_wtps = [block.radio for block in lvap.uplink.keys()]
# in case the downlink went down, the remove also the uplinks
if self.wtp in dl_wtps:
RUNTIME.remove_lvap(lvap.addr)
elif self.wtp in ul_wtps:
LOG.info("Deleting LVAP (UL): %s", lvap.addr)
lvap.clear_uplink()
# remove hosted vaps
for tenant_id in RUNTIME.tenants.keys():
for vap_id in list(RUNTIME.tenants[tenant_id].vaps.keys()):
vap = RUNTIME.tenants[tenant_id].vaps[vap_id]
if vap.wtp == self.wtp:
LOG.info("Deleting VAP: %s", vap.net_bssid)
del RUNTIME.tenants[vap.tenant_id].vaps[vap.net_bssid]
# reset state
self.wtp.last_seen = 0
self.wtp.connection = None
self.wtp.ports = {}
self.wtp.supports = ResourcePool()
self.wtp = None