location.in: fix search_networks() function call

Message ID db6aa70f-1c53-4442-ed2a-a9f4cb6ecb95@ipfire.org
State Accepted
Commit 0cb1a88c942e599329f87a04f1dde4ec4376b038
Headers
Series location.in: fix search_networks() function call |

Commit Message

Peter Müller May 16, 2021, 8:35 p.m. UTC
  Fixes: #12617

Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
---
 src/python/location.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Michael Tremer May 18, 2021, 10:31 a.m. UTC | #1
Thanks. Merged.

> On 16 May 2021, at 21:35, Peter Müller <peter.mueller@ipfire.org> wrote:
> 
> Fixes: #12617
> 
> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
> ---
> src/python/location.in | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/python/location.in b/src/python/location.in
> index ad2ccf5..e02b4e8 100644
> --- a/src/python/location.in
> +++ b/src/python/location.in
> @@ -506,7 +506,7 @@ class CLI(object):
> 			f = writer(sys.stdout, prefix=country_code)
> 
> 			# Print all matching networks
> -			for n in db.search_networks(country_code=country_code, family=ns.family):
> +			for n in db.search_networks(country_codes=[country_code], family=ns.family):
> 				f.write(n)
> 
> 			f.finish()
> -- 
> 2.26.2
  
Gisle Vanem May 18, 2021, 11:04 a.m. UTC | #2
Michael Tremer wrote:

> Thanks. Merged.
> 
>> On 16 May 2021, at 21:35, Peter Müller <peter.mueller@ipfire.org> wrote:
>>
>> Fixes: #12617
>>
>> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
>> ---
>> src/python/location.in | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/python/location.in b/src/python/location.in
>> index ad2ccf5..e02b4e8 100644
>> --- a/src/python/location.in
>> +++ b/src/python/location.in
>> @@ -506,7 +506,7 @@ class CLI(object):
>> 			f = writer(sys.stdout, prefix=country_code)
>>
>> 			# Print all matching networks
>> -			for n in db.search_networks(country_code=country_code, family=ns.family):
>> +			for n in db.search_networks(country_codes=[country_code], family=ns.family):
>> 				f.write(n)

High time. I reported this already 1 April:
   https://lists.ipfire.org/pipermail/location/2021-April/000263.html
  
Michael Tremer May 18, 2021, 11:06 a.m. UTC | #3
Hello,

Thank you for that. It would be even better if you would follow the guidelines here, so that the patch can be merged into the repository easily: https://wiki.ipfire.org/devel/submit-patches

Best,
-Michael

> On 18 May 2021, at 12:04, Gisle Vanem <gisle.vanem@gmail.com> wrote:
> 
> Michael Tremer wrote:
> 
>> Thanks. Merged.
>>> On 16 May 2021, at 21:35, Peter Müller <peter.mueller@ipfire.org> wrote:
>>> 
>>> Fixes: #12617
>>> 
>>> Signed-off-by: Peter Müller <peter.mueller@ipfire.org>
>>> ---
>>> src/python/location.in | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>> 
>>> diff --git a/src/python/location.in b/src/python/location.in
>>> index ad2ccf5..e02b4e8 100644
>>> --- a/src/python/location.in
>>> +++ b/src/python/location.in
>>> @@ -506,7 +506,7 @@ class CLI(object):
>>> 			f = writer(sys.stdout, prefix=country_code)
>>> 
>>> 			# Print all matching networks
>>> -			for n in db.search_networks(country_code=country_code, family=ns.family):
>>> +			for n in db.search_networks(country_codes=[country_code], family=ns.family):
>>> 				f.write(n)
> 
> High time. I reported this already 1 April:
>  https://lists.ipfire.org/pipermail/location/2021-April/000263.html
> 
> -- 
> --gv
  

Patch

diff --git a/src/python/location.in b/src/python/location.in
index ad2ccf5..e02b4e8 100644
--- a/src/python/location.in
+++ b/src/python/location.in
@@ -506,7 +506,7 @@  class CLI(object):
 			f = writer(sys.stdout, prefix=country_code)
 
 			# Print all matching networks
-			for n in db.search_networks(country_code=country_code, family=ns.family):
+			for n in db.search_networks(country_codes=[country_code], family=ns.family):
 				f.write(n)
 
 			f.finish()