Fixes the ASN checking to allow an ASN of 0 (#7878)

This commit is contained in:
Trenton H 2024-10-08 12:47:37 -07:00 committed by GitHub
parent facec317ef
commit cf3645c296
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -348,7 +348,7 @@ class ConsumerPlugin(
""" """
Check that if override_asn is given, it is unique and within a valid range Check that if override_asn is given, it is unique and within a valid range
""" """
if not self.metadata.asn: if self.metadata.asn is None:
# check not necessary in case no ASN gets set # check not necessary in case no ASN gets set
return return
# Validate the range is above zero and less than uint32_t max # Validate the range is above zero and less than uint32_t max
@ -905,7 +905,7 @@ class ConsumerPlugin(
pk=self.metadata.storage_path_id, pk=self.metadata.storage_path_id,
) )
if self.metadata.asn: if self.metadata.asn is not None:
document.archive_serial_number = self.metadata.asn document.archive_serial_number = self.metadata.asn
if self.metadata.owner_id: if self.metadata.owner_id: