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
Exemple #2
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
Exemple #3
0
 def test_is_valid_asn_old(self):
     ok_(validation.is_valid_asn(65000))
Exemple #4
0
 def test_is_valid_asn(self):
     ok_(validation.is_valid_asn(6553800))
Exemple #5
0
 def test_is_valid_asn_over(self):
     eq_(False, validation.is_valid_asn(0xffffffff + 1))
Exemple #6
0
 def test_is_valid_asn_negative(self):
     eq_(False, validation.is_valid_asn(-1))
Exemple #7
0
def validate_remote_as(asn):
    if not is_valid_asn(asn):
        raise ConfigValueError(desc="Invalid remote as value %s" % asn)
    return asn
Exemple #8
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
Exemple #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
Exemple #10
0
def validate_remote_as(asn):
    if not is_valid_asn(asn):
        raise ConfigValueError(desc='Invalid remote as value %s' % asn)
    return asn
Exemple #11
0
 def test_is_valid_asn(self):
     ok_(validation.is_valid_asn(6553800))
Exemple #12
0
 def test_is_valid_asn_over(self):
     eq_(False, validation.is_valid_asn(0xFFFFFFFF + 1))
Exemple #13
0
 def test_is_valid_asn_negative(self):
     eq_(False, validation.is_valid_asn(-1))
Exemple #14
0
 def test_is_valid_asn_old(self):
     ok_(validation.is_valid_asn(65000))