Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Fixes update-database script on the last few days of a month. #2121

Merged
merged 1 commit into from
Dec 1, 2021

Conversation

gethvi
Copy link
Contributor

@gethvi gethvi commented Oct 26, 2021

This should fix #2088.

@ghost ghost added this to the 3.1.0 milestone Oct 29, 2021
@ghost ghost self-assigned this Oct 29, 2021
@ghost ghost added the bug Indicates an unexpected problem or unintended behavior label Oct 29, 2021
Comment on lines 122 to 128
url += str(months[i]) + "/RIBS/"
response = session.get(url)
pattern = re.compile(r"href=\"(rib\.\d{8}\.\d{4}\.bz2)\"")
days = pattern.findall(response.text)
days.sort(reverse=True)
if days:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
url += str(months[i]) + "/RIBS/"
response = session.get(url)
pattern = re.compile(r"href=\"(rib\.\d{8}\.\d{4}\.bz2)\"")
days = pattern.findall(response.text)
days.sort(reverse=True)
if days:
new_url = url + str(months[i]) + "/RIBS/"
response = session.get(new_url)
pattern = re.compile(r"href=\"(rib\.\d{8}\.\d{4}\.bz2)\"")
days = pattern.findall(response.text)
days.sort(reverse=True)
if days:
url = new_url

Otherwise we end up with no result as http://archive.routeviews.org/route-views4/bgpdata/2021.11/RIBS/2021.10/RIBS/ is queried.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Sorry about bad PR. Should be fixed now.

@ghost ghost added the component: bots label Oct 29, 2021
@sebix sebix unassigned ghost Nov 18, 2021
Copy link
Member

@sebix sebix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Pull Request looks semantically OK. The PR can be merged as soon as someone reviews and validates the exact code changes and documents the change in the changelog.

@sebix sebix merged commit 4bf5460 into certtools:develop Dec 1, 2021
@gethvi gethvi deleted the asn-update-database-fix branch December 8, 2021 21:41
@sebix sebix self-assigned this Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior component: bots
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ASN Lookup expert database update fails after the 28th of each month
3 participants