示例#1
0
def validate_local_as(asn):
    if asn is None:
        raise MissingRequiredConf(conf_name=LOCAL_AS)

    if not is_valid_asn(asn):
        raise ConfigValueError(
            desc='Invalid local_as configuration value: %s' % asn)
    return asn
示例#2
0
文件: common.py 项目: AsmaSwapna/ryu
def validate_local_as(asn):
    if asn is None:
        raise MissingRequiredConf(conf_name=LOCAL_AS)

    if not is_valid_asn(asn):
        raise ConfigValueError(desc='Invalid local_as configuration value: %s'
                               % asn)
    return asn
示例#3
0
 def test_is_valid_asn_old(self):
     ok_(validation.is_valid_asn(65000))
示例#4
0
 def test_is_valid_asn(self):
     ok_(validation.is_valid_asn(6553800))
示例#5
0
 def test_is_valid_asn_over(self):
     eq_(False, validation.is_valid_asn(0xffffffff + 1))
示例#6
0
 def test_is_valid_asn_negative(self):
     eq_(False, validation.is_valid_asn(-1))
示例#7
0
def validate_remote_as(asn):
    if not is_valid_asn(asn):
        raise ConfigValueError(desc="Invalid remote as value %s" % asn)
    return asn
示例#8
0
文件: base.py 项目: vinaykothiyal/ryu
def validate_cap_rtc_as(rtc_as):
    if not is_valid_asn(rtc_as):
        raise ConfigValueError(desc='Invalid RTC AS configuration value: %s'
                               % rtc_as)
    return rtc_as
示例#9
0
def validate_cap_rtc_as(rtc_as):
    if not is_valid_asn(rtc_as):
        raise ConfigValueError(desc='Invalid RTC AS configuration value: %s' %
                               rtc_as)
    return rtc_as
示例#10
0
def validate_remote_as(asn):
    if not is_valid_asn(asn):
        raise ConfigValueError(desc='Invalid remote as value %s' % asn)
    return asn
示例#11
0
 def test_is_valid_asn(self):
     ok_(validation.is_valid_asn(6553800))
示例#12
0
 def test_is_valid_asn_over(self):
     eq_(False, validation.is_valid_asn(0xFFFFFFFF + 1))
示例#13
0
 def test_is_valid_asn_negative(self):
     eq_(False, validation.is_valid_asn(-1))
示例#14
0
 def test_is_valid_asn_old(self):
     ok_(validation.is_valid_asn(65000))