]> git.ipfire.org Git - oddments/ddns.git/commitdiff
ProviderDDNSS: Fix unhandled exception on update
authorStefan Schantl <stefan.schantl@ipfire.org>
Mon, 25 May 2020 16:00:51 +0000 (18:00 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Mon, 25 May 2020 16:00:51 +0000 (18:00 +0200)
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@ipfire.org>
src/ddns/providers.py

index f1fed2265c6c62510f3207039cf26f007fa3deca..46d8a67cf5b3b62af15f6013aa140e1933123085 100644 (file)
@@ -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":