public inbox for ddns@lists.ipfire.org
 help / color / mirror / Atom feed
* [PATCH] ProviderDDNSS: Fix unhandled exception on update
@ 2020-05-25 16:05 Stefan Schantl
  2020-05-26 10:11 ` Michael Tremer
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Schantl @ 2020-05-25 16:05 UTC (permalink / raw)
  To: ddns

[-- Attachment #1: Type: text/plain, Size: 917 bytes --]

In python > 3.3 the getheader() attribute is not longer part of the
urllib.response response.info() object. It is part of response object
and so directly can be accessed.

Fixes #12328

Signed-off-by: Stefan Schantl <stefan.schantl(a)ipfire.org>
---
 src/ddns/providers.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/ddns/providers.py b/src/ddns/providers.py
index f1fed22..46d8a67 100644
--- a/src/ddns/providers.py
+++ b/src/ddns/providers.py
@@ -642,10 +642,8 @@ class DDNSProviderDDNSS(DDNSProvider):
 		response = self.send_request(self.url, data=data)
 
 		# This provider sends the response code as part of the header.
-		header = response.info()
-
 		# Get status information from the header.
-		output = header.getheader('ddnss-response')
+		output = response.getheader('ddnss-response')
 
 		# Handle success messages.
 		if output == "good" or output == "nochg":
-- 
2.26.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ProviderDDNSS: Fix unhandled exception on update
  2020-05-25 16:05 [PATCH] ProviderDDNSS: Fix unhandled exception on update Stefan Schantl
@ 2020-05-26 10:11 ` Michael Tremer
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Tremer @ 2020-05-26 10:11 UTC (permalink / raw)
  To: ddns

[-- Attachment #1: Type: text/plain, Size: 1236 bytes --]

Reviewed-by: Michael Tremer <michael.tremer(a)ipfire.org>

Did you send this to any of the people affected by the problem to test it?

-Michael

> On 25 May 2020, at 17:05, Stefan Schantl <stefan.schantl(a)ipfire.org> wrote:
> 
> In python > 3.3 the getheader() attribute is not longer part of the
> urllib.response response.info() object. It is part of response object
> and so directly can be accessed.
> 
> Fixes #12328
> 
> Signed-off-by: Stefan Schantl <stefan.schantl(a)ipfire.org>
> ---
> src/ddns/providers.py | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/src/ddns/providers.py b/src/ddns/providers.py
> index f1fed22..46d8a67 100644
> --- a/src/ddns/providers.py
> +++ b/src/ddns/providers.py
> @@ -642,10 +642,8 @@ class DDNSProviderDDNSS(DDNSProvider):
> 		response = self.send_request(self.url, data=data)
> 
> 		# This provider sends the response code as part of the header.
> -		header = response.info()
> -
> 		# Get status information from the header.
> -		output = header.getheader('ddnss-response')
> +		output = response.getheader('ddnss-response')
> 
> 		# Handle success messages.
> 		if output == "good" or output == "nochg":
> -- 
> 2.26.1
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-26 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25 16:05 [PATCH] ProviderDDNSS: Fix unhandled exception on update Stefan Schantl
2020-05-26 10:11 ` Michael Tremer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox