本文整理汇总了Python中ryu.services.protocols.bgp.base.get_validator函数的典型用法代码示例。如果您正苦于以下问题:Python get_validator函数的具体用法?Python get_validator怎么用?Python get_validator使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_validator函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _update_med
def _update_med(self, **kwargs):
multi_exit_disc = kwargs.get(MULTI_EXIT_DISC, None)
if multi_exit_disc:
get_validator(MULTI_EXIT_DISC)(multi_exit_disc)
if multi_exit_disc != self.multi_exit_disc:
self._settings[MULTI_EXIT_DISC] = multi_exit_disc
return True
return False
开发者ID:AkiraSuu,项目名称:ryu,代码行数:10,代码来源:vrfs.py
示例2: description
def description(self, new_description):
old_desc = self.description
if not new_description:
new_description = str(self)
else:
get_validator(ConfWithId.DESCRIPTION)(new_description)
if old_desc != new_description:
self._settings[ConfWithId.DESCRIPTION] = new_description
self._notify_listeners(ConfWithId.UPDATE_DESCRIPTION_EVT,
(old_desc, self.description))
开发者ID:Aries-Sushi,项目名称:ryu,代码行数:11,代码来源:base.py
示例3: name
def name(self, new_name):
old_name = self.name
if not new_name:
new_name = repr(self)
else:
get_validator(ConfWithId.NAME)(new_name)
if old_name != new_name:
self._settings[ConfWithId.NAME] = new_name
self._notify_listeners(ConfWithId.UPDATE_NAME_EVT,
(old_name, self.name))
开发者ID:Aries-Sushi,项目名称:ryu,代码行数:11,代码来源:base.py
示例4: _update_soo_list
def _update_soo_list(self, **kwargs):
soo_list = kwargs.get(SITE_OF_ORIGINS, [])
get_validator(SITE_OF_ORIGINS)(soo_list)
curr_soos = set(self.soo_list)
# If given list is different from existing settings, we update it
if curr_soos.symmetric_difference(soo_list):
self._settings[SITE_OF_ORIGINS] = soo_list[:]
return True
return False
开发者ID:AkiraSuu,项目名称:ryu,代码行数:11,代码来源:vrfs.py
示例5: _update_export_rts
def _update_export_rts(self, **kwargs):
export_rts = kwargs.get(EXPORT_RTS)
get_validator(EXPORT_RTS)(export_rts)
curr_export_rts = set(self._settings[EXPORT_RTS])
if curr_export_rts.symmetric_difference(export_rts):
# Update current RTs and notify listeners.
self._settings[EXPORT_RTS] = list(export_rts)
return True
return False
开发者ID:AkiraSuu,项目名称:ryu,代码行数:11,代码来源:vrfs.py
示例6: compute_optional_conf
def compute_optional_conf(conf_name, default_value, **all_config):
"""Returns *conf_name* settings if provided in *all_config*, else returns
*default_value*.
Validates *conf_name* value if provided.
"""
conf_value = all_config.get(conf_name)
if conf_value is not None:
# Validate configuration value.
get_validator(conf_name)(conf_value)
else:
conf_value = default_value
return conf_value
开发者ID:alextwl,项目名称:ryu,代码行数:13,代码来源:base.py
示例7: _update_import_rts
def _update_import_rts(self, **kwargs):
import_rts = kwargs.get(IMPORT_RTS)
get_validator(IMPORT_RTS)(import_rts)
curr_import_rts = set(self._settings[IMPORT_RTS])
import_rts = set(import_rts)
if not import_rts.symmetric_difference(curr_import_rts):
return (None, None)
# Get the difference between current and new RTs
new_import_rts = import_rts - curr_import_rts
old_import_rts = curr_import_rts - import_rts
# Update current RTs and notify listeners.
self._settings[IMPORT_RTS] = import_rts
return (new_import_rts, old_import_rts)
开发者ID:AkiraSuu,项目名称:ryu,代码行数:16,代码来源:vrfs.py
示例8: _init_req_settings
def _init_req_settings(self, **kwargs):
for req_attr in self._req_settings:
req_attr_value = kwargs.get(req_attr)
if req_attr_value is None:
raise MissingRequiredConf(conf_name=req_attr_value)
# Validate attribute value
req_attr_value = get_validator(req_attr)(req_attr_value)
self._settings[req_attr] = req_attr_value
开发者ID:Aries-Sushi,项目名称:ryu,代码行数:8,代码来源:base.py
示例9: stats_time
def stats_time(self, stats_time):
get_validator(ConfWithStats.STATS_TIME)(stats_time)
if stats_time != self.stats_time:
self._settings[ConfWithStats.STATS_TIME] = stats_time
self._notify_listeners(ConfWithStats.UPDATE_STATS_TIME_EVT,
stats_time)
开发者ID:Aries-Sushi,项目名称:ryu,代码行数:6,代码来源:base.py
示例10: stats_log_enabled
def stats_log_enabled(self, enabled):
get_validator(ConfWithStats.STATS_LOG_ENABLED)(enabled)
if enabled != self.stats_log_enabled:
self._settings[ConfWithStats.STATS_LOG_ENABLED] = enabled
self._notify_listeners(ConfWithStats.UPDATE_STATS_LOG_ENABLED_EVT,
enabled)
开发者ID:Aries-Sushi,项目名称:ryu,代码行数:6,代码来源:base.py
注:本文中的ryu.services.protocols.bgp.base.get_validator函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论