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
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
def test_is_valid_asn_old(self): ok_(validation.is_valid_asn(65000))
def test_is_valid_asn(self): ok_(validation.is_valid_asn(6553800))
def test_is_valid_asn_over(self): eq_(False, validation.is_valid_asn(0xffffffff + 1))
def test_is_valid_asn_negative(self): eq_(False, validation.is_valid_asn(-1))
def validate_remote_as(asn): if not is_valid_asn(asn): raise ConfigValueError(desc="Invalid remote as value %s" % asn) return asn
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
def validate_remote_as(asn): if not is_valid_asn(asn): raise ConfigValueError(desc='Invalid remote as value %s' % asn) return asn
def test_is_valid_asn_over(self): eq_(False, validation.is_valid_asn(0xFFFFFFFF + 1))