本文整理汇总了Python中exabgp.protocol.family.SAFI.value方法的典型用法代码示例。如果您正苦于以下问题:Python SAFI.value方法的具体用法?Python SAFI.value怎么用?Python SAFI.value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exabgp.protocol.family.SAFI
的用法示例。
在下文中一共展示了SAFI.value方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse_api_refresh
# 需要导入模块: from exabgp.protocol.family import SAFI [as 别名]
# 或者: from exabgp.protocol.family.SAFI import value [as 别名]
def parse_api_refresh (self,command):
tokens = formated(command).split(' ')[2:]
if len(tokens) != 2:
return False
afi = AFI.value(tokens.pop(0))
safi = SAFI.value(tokens.pop(0))
if afi is None or safi is None:
return False
return RouteRefresh(afi,safi)
示例2: _add
# 需要导入模块: from exabgp.protocol.family import SAFI [as 别名]
# 或者: from exabgp.protocol.family.SAFI import value [as 别名]
def _add (self,tokeniser,afi_name,safi_names):
self._check_duplicate(tokeniser,RaisedFamily)
known = self.content.setdefault(AFI(AFI.value(afi_name)),[])
for (idx_line,idx_column,line,safi_name) in safi_names:
if safi_name not in AFI.implemented_safi(afi_name):
raise RaisedFamily(Location(idx_line,idx_column,line),'the family pair afi/safi %s/%s is unimplemented' % (afi_name,safi_name))
safi = SAFI(SAFI.value(safi_name))
if safi in known:
raise RaisedFamily(Location(idx_line,idx_column,line),'afi/safi pair already defined in this family')
known.append(safi)