[v2,2/2] importer.py: add source information for RIR data feeds

Message ID 20210522203352.22746-2-peter.mueller@ipfire.org
State Accepted
Headers
Series [v2,1/2] location-importer.in: keep track of sources for networks, ASNs, and organisations |

Commit Message

Peter Müller May 22, 2021, 8:33 p.m. UTC
  Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
 src/python/importer.py | 66 +++++++++++++++++++++++++++---------------
 1 file changed, 42 insertions(+), 24 deletions(-)
  

Comments

Michael Tremer May 25, 2021, 10:30 a.m. UTC | #1
Hallo,

This probably should have been in the first patch because it won’t work without this.

Best,
-Michael

> On 22 May 2021, at 21:33, Peter Müller <peter.mueller@ipfire.org> wrote:
> 
> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
> ---
> src/python/importer.py | 66 +++++++++++++++++++++++++++---------------
> 1 file changed, 42 insertions(+), 24 deletions(-)
> 
> diff --git a/src/python/importer.py b/src/python/importer.py
> index 5f46bc3..4c8406c 100644
> --- a/src/python/importer.py
> +++ b/src/python/importer.py
> @@ -25,50 +25,68 @@ import urllib.request
> log = logging.getLogger("location.importer")
> log.propagate = 1
> 
> -WHOIS_SOURCES = (
> +WHOIS_SOURCES = {
> 	# African Network Information Centre
> -	"https://ftp.afrinic.net/pub/pub/dbase/afrinic.db.gz",
> +	"AFRINIC": [
> +		"https://ftp.afrinic.net/pub/pub/dbase/afrinic.db.gz"
> +		],
> 
> 	# Asia Pacific Network Information Centre
> -	"https://ftp.apnic.net/apnic/whois/apnic.db.inet6num.gz",
> -	"https://ftp.apnic.net/apnic/whois/apnic.db.inetnum.gz",
> -	#"https://ftp.apnic.net/apnic/whois/apnic.db.route6.gz",
> -	#"https://ftp.apnic.net/apnic/whois/apnic.db.route.gz",
> -	"https://ftp.apnic.net/apnic/whois/apnic.db.aut-num.gz",
> -	"https://ftp.apnic.net/apnic/whois/apnic.db.organisation.gz",
> +	"APNIC": [
> +		"https://ftp.apnic.net/apnic/whois/apnic.db.inet6num.gz",
> +		"https://ftp.apnic.net/apnic/whois/apnic.db.inetnum.gz",
> +		#"https://ftp.apnic.net/apnic/whois/apnic.db.route6.gz",
> +		#"https://ftp.apnic.net/apnic/whois/apnic.db.route.gz",
> +		"https://ftp.apnic.net/apnic/whois/apnic.db.aut-num.gz",
> +		"https://ftp.apnic.net/apnic/whois/apnic.db.organisation.gz"
> +		],
> 
> 	# American Registry for Internet Numbers
> 	# XXX there is nothing useful for us in here
> -	#"https://ftp.arin.net/pub/rr/arin.db",
> +	# ARIN: [
> +	#	"https://ftp.arin.net/pub/rr/arin.db"
> +	# ],
> 
> 	# Latin America and Caribbean Network Information Centre
> 	# XXX ???
> 
> 	# Réseaux IP Européens
> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inet6num.gz",
> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inetnum.gz",
> -	#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route6.gz",
> -	#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route.gz",
> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz",
> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.organisation.gz",
> -)
> -
> -EXTENDED_SOURCES = (
> +	"RIPE": [
> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inet6num.gz",
> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inetnum.gz",
> +		#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route6.gz",
> +		#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route.gz",
> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz",
> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.organisation.gz"
> +		],
> +}
> +
> +EXTENDED_SOURCES = {
> 	# African Network Information Centre
> -	#"https://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-extended-latest",
> +	# "ARIN": [
> +	#	"https://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-extended-latest"
> +	# ],
> 
> 	# Asia Pacific Network Information Centre
> -	#"https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-extended-latest",
> +	# "APNIC": [
> +	#	"https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-extended-latest"
> +	# ],
> 
> 	# American Registry for Internet Numbers
> -	"https://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest",
> +	"ARIN": [
> +		"https://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest"
> +		],
> 
> 	# Latin America and Caribbean Network Information Centre
> -	"https://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest",
> +	"LACNIC": [
> +		"https://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest"
> +		],
> 
> 	# Réseaux IP Européens
> -	#"https://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest",
> -)
> +	# "RIPE": [
> +	#	"https://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest"
> +	# ],
> +}
> 
> class Downloader(object):
> 	def __init__(self):
> -- 
> 2.20.1
>
  
Peter Müller May 26, 2021, 6:11 p.m. UTC | #2
Hello Michael,

thanks for your reply.

I am not sure if I understood you correctly. What am I missing in which patch(set)?

Thanks, and best regards,
Peter Müller


> Hallo,
> 
> This probably should have been in the first patch because it won’t work without this.
> 
> Best,
> -Michael
> 
>> On 22 May 2021, at 21:33, Peter Müller <peter.mueller@ipfire.org> wrote:
>>
>> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
>> ---
>> src/python/importer.py | 66 +++++++++++++++++++++++++++---------------
>> 1 file changed, 42 insertions(+), 24 deletions(-)
>>
>> diff --git a/src/python/importer.py b/src/python/importer.py
>> index 5f46bc3..4c8406c 100644
>> --- a/src/python/importer.py
>> +++ b/src/python/importer.py
>> @@ -25,50 +25,68 @@ import urllib.request
>> log = logging.getLogger("location.importer")
>> log.propagate = 1
>>
>> -WHOIS_SOURCES = (
>> +WHOIS_SOURCES = {
>> 	# African Network Information Centre
>> -	"https://ftp.afrinic.net/pub/pub/dbase/afrinic.db.gz",
>> +	"AFRINIC": [
>> +		"https://ftp.afrinic.net/pub/pub/dbase/afrinic.db.gz"
>> +		],
>>
>> 	# Asia Pacific Network Information Centre
>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.inet6num.gz",
>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.inetnum.gz",
>> -	#"https://ftp.apnic.net/apnic/whois/apnic.db.route6.gz",
>> -	#"https://ftp.apnic.net/apnic/whois/apnic.db.route.gz",
>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.aut-num.gz",
>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.organisation.gz",
>> +	"APNIC": [
>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.inet6num.gz",
>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.inetnum.gz",
>> +		#"https://ftp.apnic.net/apnic/whois/apnic.db.route6.gz",
>> +		#"https://ftp.apnic.net/apnic/whois/apnic.db.route.gz",
>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.aut-num.gz",
>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.organisation.gz"
>> +		],
>>
>> 	# American Registry for Internet Numbers
>> 	# XXX there is nothing useful for us in here
>> -	#"https://ftp.arin.net/pub/rr/arin.db",
>> +	# ARIN: [
>> +	#	"https://ftp.arin.net/pub/rr/arin.db"
>> +	# ],
>>
>> 	# Latin America and Caribbean Network Information Centre
>> 	# XXX ???
>>
>> 	# Réseaux IP Européens
>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inet6num.gz",
>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inetnum.gz",
>> -	#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route6.gz",
>> -	#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route.gz",
>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz",
>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.organisation.gz",
>> -)
>> -
>> -EXTENDED_SOURCES = (
>> +	"RIPE": [
>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inet6num.gz",
>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inetnum.gz",
>> +		#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route6.gz",
>> +		#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route.gz",
>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz",
>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.organisation.gz"
>> +		],
>> +}
>> +
>> +EXTENDED_SOURCES = {
>> 	# African Network Information Centre
>> -	#"https://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-extended-latest",
>> +	# "ARIN": [
>> +	#	"https://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-extended-latest"
>> +	# ],
>>
>> 	# Asia Pacific Network Information Centre
>> -	#"https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-extended-latest",
>> +	# "APNIC": [
>> +	#	"https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-extended-latest"
>> +	# ],
>>
>> 	# American Registry for Internet Numbers
>> -	"https://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest",
>> +	"ARIN": [
>> +		"https://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest"
>> +		],
>>
>> 	# Latin America and Caribbean Network Information Centre
>> -	"https://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest",
>> +	"LACNIC": [
>> +		"https://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest"
>> +		],
>>
>> 	# Réseaux IP Européens
>> -	#"https://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest",
>> -)
>> +	# "RIPE": [
>> +	#	"https://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest"
>> +	# ],
>> +}
>>
>> class Downloader(object):
>> 	def __init__(self):
>> -- 
>> 2.20.1
>>
>
  
Michael Tremer May 27, 2021, 10:50 a.m. UTC | #3
Nothing. It is merged.

I am just saying that you split one change into two, but merging only one patch breaks the code - and that shouldn’t happen.

-Michael

> On 26 May 2021, at 19:11, Peter Müller <peter.mueller@ipfire.org> wrote:
> 
> Hello Michael,
> 
> thanks for your reply.
> 
> I am not sure if I understood you correctly. What am I missing in which patch(set)?
> 
> Thanks, and best regards,
> Peter Müller
> 
> 
>> Hallo,
>> 
>> This probably should have been in the first patch because it won’t work without this.
>> 
>> Best,
>> -Michael
>> 
>>> On 22 May 2021, at 21:33, Peter Müller <peter.mueller@ipfire.org> wrote:
>>> 
>>> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
>>> ---
>>> src/python/importer.py | 66 +++++++++++++++++++++++++++---------------
>>> 1 file changed, 42 insertions(+), 24 deletions(-)
>>> 
>>> diff --git a/src/python/importer.py b/src/python/importer.py
>>> index 5f46bc3..4c8406c 100644
>>> --- a/src/python/importer.py
>>> +++ b/src/python/importer.py
>>> @@ -25,50 +25,68 @@ import urllib.request
>>> log = logging.getLogger("location.importer")
>>> log.propagate = 1
>>> 
>>> -WHOIS_SOURCES = (
>>> +WHOIS_SOURCES = {
>>> 	# African Network Information Centre
>>> -	"https://ftp.afrinic.net/pub/pub/dbase/afrinic.db.gz",
>>> +	"AFRINIC": [
>>> +		"https://ftp.afrinic.net/pub/pub/dbase/afrinic.db.gz"
>>> +		],
>>> 
>>> 	# Asia Pacific Network Information Centre
>>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.inet6num.gz",
>>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.inetnum.gz",
>>> -	#"https://ftp.apnic.net/apnic/whois/apnic.db.route6.gz",
>>> -	#"https://ftp.apnic.net/apnic/whois/apnic.db.route.gz",
>>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.aut-num.gz",
>>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.organisation.gz",
>>> +	"APNIC": [
>>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.inet6num.gz",
>>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.inetnum.gz",
>>> +		#"https://ftp.apnic.net/apnic/whois/apnic.db.route6.gz",
>>> +		#"https://ftp.apnic.net/apnic/whois/apnic.db.route.gz",
>>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.aut-num.gz",
>>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.organisation.gz"
>>> +		],
>>> 
>>> 	# American Registry for Internet Numbers
>>> 	# XXX there is nothing useful for us in here
>>> -	#"https://ftp.arin.net/pub/rr/arin.db",
>>> +	# ARIN: [
>>> +	#	"https://ftp.arin.net/pub/rr/arin.db"
>>> +	# ],
>>> 
>>> 	# Latin America and Caribbean Network Information Centre
>>> 	# XXX ???
>>> 
>>> 	# Réseaux IP Européens
>>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inet6num.gz",
>>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inetnum.gz",
>>> -	#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route6.gz",
>>> -	#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route.gz",
>>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz",
>>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.organisation.gz",
>>> -)
>>> -
>>> -EXTENDED_SOURCES = (
>>> +	"RIPE": [
>>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inet6num.gz",
>>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inetnum.gz",
>>> +		#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route6.gz",
>>> +		#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route.gz",
>>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz",
>>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.organisation.gz"
>>> +		],
>>> +}
>>> +
>>> +EXTENDED_SOURCES = {
>>> 	# African Network Information Centre
>>> -	#"https://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-extended-latest",
>>> +	# "ARIN": [
>>> +	#	"https://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-extended-latest"
>>> +	# ],
>>> 
>>> 	# Asia Pacific Network Information Centre
>>> -	#"https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-extended-latest",
>>> +	# "APNIC": [
>>> +	#	"https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-extended-latest"
>>> +	# ],
>>> 
>>> 	# American Registry for Internet Numbers
>>> -	"https://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest",
>>> +	"ARIN": [
>>> +		"https://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest"
>>> +		],
>>> 
>>> 	# Latin America and Caribbean Network Information Centre
>>> -	"https://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest",
>>> +	"LACNIC": [
>>> +		"https://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest"
>>> +		],
>>> 
>>> 	# Réseaux IP Européens
>>> -	#"https://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest",
>>> -)
>>> +	# "RIPE": [
>>> +	#	"https://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest"
>>> +	# ],
>>> +}
>>> 
>>> class Downloader(object):
>>> 	def __init__(self):
>>> -- 
>>> 2.20.1
>>> 
>>
  
Peter Müller May 30, 2021, 8:08 a.m. UTC | #4
Hello Michael,

thanks for your reply.

Actually, I have never looked at patchsets being able to work in part - to me, they always seemed to be atomic.
Good to know this is wrong, I guess... :-)

Thanks, and best regards,
Peter Müller

> Nothing. It is merged.
> 
> I am just saying that you split one change into two, but merging only one patch breaks the code - and that shouldn’t happen.
> 
> -Michael
> 
>> On 26 May 2021, at 19:11, Peter Müller <peter.mueller@ipfire.org> wrote:
>>
>> Hello Michael,
>>
>> thanks for your reply.
>>
>> I am not sure if I understood you correctly. What am I missing in which patch(set)?
>>
>> Thanks, and best regards,
>> Peter Müller
>>
>>
>>> Hallo,
>>>
>>> This probably should have been in the first patch because it won’t work without this.
>>>
>>> Best,
>>> -Michael
>>>
>>>> On 22 May 2021, at 21:33, Peter Müller <peter.mueller@ipfire.org> wrote:
>>>>
>>>> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
>>>> ---
>>>> src/python/importer.py | 66 +++++++++++++++++++++++++++---------------
>>>> 1 file changed, 42 insertions(+), 24 deletions(-)
>>>>
>>>> diff --git a/src/python/importer.py b/src/python/importer.py
>>>> index 5f46bc3..4c8406c 100644
>>>> --- a/src/python/importer.py
>>>> +++ b/src/python/importer.py
>>>> @@ -25,50 +25,68 @@ import urllib.request
>>>> log = logging.getLogger("location.importer")
>>>> log.propagate = 1
>>>>
>>>> -WHOIS_SOURCES = (
>>>> +WHOIS_SOURCES = {
>>>> 	# African Network Information Centre
>>>> -	"https://ftp.afrinic.net/pub/pub/dbase/afrinic.db.gz",
>>>> +	"AFRINIC": [
>>>> +		"https://ftp.afrinic.net/pub/pub/dbase/afrinic.db.gz"
>>>> +		],
>>>>
>>>> 	# Asia Pacific Network Information Centre
>>>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.inet6num.gz",
>>>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.inetnum.gz",
>>>> -	#"https://ftp.apnic.net/apnic/whois/apnic.db.route6.gz",
>>>> -	#"https://ftp.apnic.net/apnic/whois/apnic.db.route.gz",
>>>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.aut-num.gz",
>>>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.organisation.gz",
>>>> +	"APNIC": [
>>>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.inet6num.gz",
>>>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.inetnum.gz",
>>>> +		#"https://ftp.apnic.net/apnic/whois/apnic.db.route6.gz",
>>>> +		#"https://ftp.apnic.net/apnic/whois/apnic.db.route.gz",
>>>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.aut-num.gz",
>>>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.organisation.gz"
>>>> +		],
>>>>
>>>> 	# American Registry for Internet Numbers
>>>> 	# XXX there is nothing useful for us in here
>>>> -	#"https://ftp.arin.net/pub/rr/arin.db",
>>>> +	# ARIN: [
>>>> +	#	"https://ftp.arin.net/pub/rr/arin.db"
>>>> +	# ],
>>>>
>>>> 	# Latin America and Caribbean Network Information Centre
>>>> 	# XXX ???
>>>>
>>>> 	# Réseaux IP Européens
>>>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inet6num.gz",
>>>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inetnum.gz",
>>>> -	#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route6.gz",
>>>> -	#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route.gz",
>>>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz",
>>>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.organisation.gz",
>>>> -)
>>>> -
>>>> -EXTENDED_SOURCES = (
>>>> +	"RIPE": [
>>>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inet6num.gz",
>>>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inetnum.gz",
>>>> +		#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route6.gz",
>>>> +		#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route.gz",
>>>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz",
>>>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.organisation.gz"
>>>> +		],
>>>> +}
>>>> +
>>>> +EXTENDED_SOURCES = {
>>>> 	# African Network Information Centre
>>>> -	#"https://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-extended-latest",
>>>> +	# "ARIN": [
>>>> +	#	"https://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-extended-latest"
>>>> +	# ],
>>>>
>>>> 	# Asia Pacific Network Information Centre
>>>> -	#"https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-extended-latest",
>>>> +	# "APNIC": [
>>>> +	#	"https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-extended-latest"
>>>> +	# ],
>>>>
>>>> 	# American Registry for Internet Numbers
>>>> -	"https://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest",
>>>> +	"ARIN": [
>>>> +		"https://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest"
>>>> +		],
>>>>
>>>> 	# Latin America and Caribbean Network Information Centre
>>>> -	"https://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest",
>>>> +	"LACNIC": [
>>>> +		"https://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest"
>>>> +		],
>>>>
>>>> 	# Réseaux IP Européens
>>>> -	#"https://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest",
>>>> -)
>>>> +	# "RIPE": [
>>>> +	#	"https://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest"
>>>> +	# ],
>>>> +}
>>>>
>>>> class Downloader(object):
>>>> 	def __init__(self):
>>>> -- 
>>>> 2.20.1
>>>>
>>>
>
  
Michael Tremer May 31, 2021, 12:25 p.m. UTC | #5
Hello,

> On 30 May 2021, at 09:08, Peter Müller <peter.mueller@ipfire.org> wrote:
> 
> Hello Michael,
> 
> thanks for your reply.
> 
> Actually, I have never looked at patchsets being able to work in part - to me, they always seemed to be atomic.
> Good to know this is wrong, I guess... :-)

Sometimes it is difficult to do this, but it would be good to have them at least compile and run so that “git bisect” can be used.

-Michael

> Thanks, and best regards,
> Peter Müller
> 
>> Nothing. It is merged.
>> 
>> I am just saying that you split one change into two, but merging only one patch breaks the code - and that shouldn’t happen.
>> 
>> -Michael
>> 
>>> On 26 May 2021, at 19:11, Peter Müller <peter.mueller@ipfire.org> wrote:
>>> 
>>> Hello Michael,
>>> 
>>> thanks for your reply.
>>> 
>>> I am not sure if I understood you correctly. What am I missing in which patch(set)?
>>> 
>>> Thanks, and best regards,
>>> Peter Müller
>>> 
>>> 
>>>> Hallo,
>>>> 
>>>> This probably should have been in the first patch because it won’t work without this.
>>>> 
>>>> Best,
>>>> -Michael
>>>> 
>>>>> On 22 May 2021, at 21:33, Peter Müller <peter.mueller@ipfire.org> wrote:
>>>>> 
>>>>> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
>>>>> ---
>>>>> src/python/importer.py | 66 +++++++++++++++++++++++++++---------------
>>>>> 1 file changed, 42 insertions(+), 24 deletions(-)
>>>>> 
>>>>> diff --git a/src/python/importer.py b/src/python/importer.py
>>>>> index 5f46bc3..4c8406c 100644
>>>>> --- a/src/python/importer.py
>>>>> +++ b/src/python/importer.py
>>>>> @@ -25,50 +25,68 @@ import urllib.request
>>>>> log = logging.getLogger("location.importer")
>>>>> log.propagate = 1
>>>>> 
>>>>> -WHOIS_SOURCES = (
>>>>> +WHOIS_SOURCES = {
>>>>> 	# African Network Information Centre
>>>>> -	"https://ftp.afrinic.net/pub/pub/dbase/afrinic.db.gz",
>>>>> +	"AFRINIC": [
>>>>> +		"https://ftp.afrinic.net/pub/pub/dbase/afrinic.db.gz"
>>>>> +		],
>>>>> 
>>>>> 	# Asia Pacific Network Information Centre
>>>>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.inet6num.gz",
>>>>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.inetnum.gz",
>>>>> -	#"https://ftp.apnic.net/apnic/whois/apnic.db.route6.gz",
>>>>> -	#"https://ftp.apnic.net/apnic/whois/apnic.db.route.gz",
>>>>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.aut-num.gz",
>>>>> -	"https://ftp.apnic.net/apnic/whois/apnic.db.organisation.gz",
>>>>> +	"APNIC": [
>>>>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.inet6num.gz",
>>>>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.inetnum.gz",
>>>>> +		#"https://ftp.apnic.net/apnic/whois/apnic.db.route6.gz",
>>>>> +		#"https://ftp.apnic.net/apnic/whois/apnic.db.route.gz",
>>>>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.aut-num.gz",
>>>>> +		"https://ftp.apnic.net/apnic/whois/apnic.db.organisation.gz"
>>>>> +		],
>>>>> 
>>>>> 	# American Registry for Internet Numbers
>>>>> 	# XXX there is nothing useful for us in here
>>>>> -	#"https://ftp.arin.net/pub/rr/arin.db",
>>>>> +	# ARIN: [
>>>>> +	#	"https://ftp.arin.net/pub/rr/arin.db"
>>>>> +	# ],
>>>>> 
>>>>> 	# Latin America and Caribbean Network Information Centre
>>>>> 	# XXX ???
>>>>> 
>>>>> 	# Réseaux IP Européens
>>>>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inet6num.gz",
>>>>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inetnum.gz",
>>>>> -	#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route6.gz",
>>>>> -	#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route.gz",
>>>>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz",
>>>>> -	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.organisation.gz",
>>>>> -)
>>>>> -
>>>>> -EXTENDED_SOURCES = (
>>>>> +	"RIPE": [
>>>>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inet6num.gz",
>>>>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inetnum.gz",
>>>>> +		#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route6.gz",
>>>>> +		#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route.gz",
>>>>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz",
>>>>> +		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.organisation.gz"
>>>>> +		],
>>>>> +}
>>>>> +
>>>>> +EXTENDED_SOURCES = {
>>>>> 	# African Network Information Centre
>>>>> -	#"https://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-extended-latest",
>>>>> +	# "ARIN": [
>>>>> +	#	"https://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-extended-latest"
>>>>> +	# ],
>>>>> 
>>>>> 	# Asia Pacific Network Information Centre
>>>>> -	#"https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-extended-latest",
>>>>> +	# "APNIC": [
>>>>> +	#	"https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-extended-latest"
>>>>> +	# ],
>>>>> 
>>>>> 	# American Registry for Internet Numbers
>>>>> -	"https://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest",
>>>>> +	"ARIN": [
>>>>> +		"https://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest"
>>>>> +		],
>>>>> 
>>>>> 	# Latin America and Caribbean Network Information Centre
>>>>> -	"https://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest",
>>>>> +	"LACNIC": [
>>>>> +		"https://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest"
>>>>> +		],
>>>>> 
>>>>> 	# Réseaux IP Européens
>>>>> -	#"https://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest",
>>>>> -)
>>>>> +	# "RIPE": [
>>>>> +	#	"https://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest"
>>>>> +	# ],
>>>>> +}
>>>>> 
>>>>> class Downloader(object):
>>>>> 	def __init__(self):
>>>>> -- 
>>>>> 2.20.1
>>>>> 
>>>> 
>>
  

Patch

diff --git a/src/python/importer.py b/src/python/importer.py
index 5f46bc3..4c8406c 100644
--- a/src/python/importer.py
+++ b/src/python/importer.py
@@ -25,50 +25,68 @@  import urllib.request
 log = logging.getLogger("location.importer")
 log.propagate = 1
 
-WHOIS_SOURCES = (
+WHOIS_SOURCES = {
 	# African Network Information Centre
-	"https://ftp.afrinic.net/pub/pub/dbase/afrinic.db.gz",
+	"AFRINIC": [
+		"https://ftp.afrinic.net/pub/pub/dbase/afrinic.db.gz"
+		],
 
 	# Asia Pacific Network Information Centre
-	"https://ftp.apnic.net/apnic/whois/apnic.db.inet6num.gz",
-	"https://ftp.apnic.net/apnic/whois/apnic.db.inetnum.gz",
-	#"https://ftp.apnic.net/apnic/whois/apnic.db.route6.gz",
-	#"https://ftp.apnic.net/apnic/whois/apnic.db.route.gz",
-	"https://ftp.apnic.net/apnic/whois/apnic.db.aut-num.gz",
-	"https://ftp.apnic.net/apnic/whois/apnic.db.organisation.gz",
+	"APNIC": [
+		"https://ftp.apnic.net/apnic/whois/apnic.db.inet6num.gz",
+		"https://ftp.apnic.net/apnic/whois/apnic.db.inetnum.gz",
+		#"https://ftp.apnic.net/apnic/whois/apnic.db.route6.gz",
+		#"https://ftp.apnic.net/apnic/whois/apnic.db.route.gz",
+		"https://ftp.apnic.net/apnic/whois/apnic.db.aut-num.gz",
+		"https://ftp.apnic.net/apnic/whois/apnic.db.organisation.gz"
+		],
 
 	# American Registry for Internet Numbers
 	# XXX there is nothing useful for us in here
-	#"https://ftp.arin.net/pub/rr/arin.db",
+	# ARIN: [
+	#	"https://ftp.arin.net/pub/rr/arin.db"
+	# ],
 
 	# Latin America and Caribbean Network Information Centre
 	# XXX ???
 
 	# Réseaux IP Européens
-	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inet6num.gz",
-	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inetnum.gz",
-	#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route6.gz",
-	#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route.gz",
-	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz",
-	"https://ftp.ripe.net/ripe/dbase/split/ripe.db.organisation.gz",
-)
-
-EXTENDED_SOURCES = (
+	"RIPE": [
+		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inet6num.gz",
+		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.inetnum.gz",
+		#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route6.gz",
+		#"https://ftp.ripe.net/ripe/dbase/split/ripe.db.route.gz",
+		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz",
+		"https://ftp.ripe.net/ripe/dbase/split/ripe.db.organisation.gz"
+		],
+}
+
+EXTENDED_SOURCES = {
 	# African Network Information Centre
-	#"https://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-extended-latest",
+	# "ARIN": [
+	#	"https://ftp.afrinic.net/pub/stats/afrinic/delegated-afrinic-extended-latest"
+	# ],
 
 	# Asia Pacific Network Information Centre
-	#"https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-extended-latest",
+	# "APNIC": [
+	#	"https://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-extended-latest"
+	# ],
 
 	# American Registry for Internet Numbers
-	"https://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest",
+	"ARIN": [
+		"https://ftp.arin.net/pub/stats/arin/delegated-arin-extended-latest"
+		],
 
 	# Latin America and Caribbean Network Information Centre
-	"https://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest",
+	"LACNIC": [
+		"https://ftp.lacnic.net/pub/stats/lacnic/delegated-lacnic-extended-latest"
+		],
 
 	# Réseaux IP Européens
-	#"https://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest",
-)
+	# "RIPE": [
+	#	"https://ftp.ripe.net/pub/stats/ripencc/delegated-ripencc-extended-latest"
+	# ],
+}
 
 class Downloader(object):
 	def __init__(self):