]> git.ipfire.org Git - people/ms/ddns.git/blobdiff - src/ddns/providers.py
dynu: Fix updating if no IPv6 address is available.
[people/ms/ddns.git] / src / ddns / providers.py
index 6ab9073ecee6a7a283dffcfcbcb0f2a2342717c2..4e35a9960a96390fc4f470b4149c49a078cac4e4 100644 (file)
@@ -516,9 +516,11 @@ class DDNSProviderDynU(DDNSProtocolDynDNS2, DDNSProvider):
                data = DDNSProtocolDynDNS2._prepare_request_data(self)
 
                # This one supports IPv6
-               data.update({
-                       "myipv6"   : self.get_address("ipv6"),
-               })
+               myipv6 = self.get_address("ipv6")
+
+               # Add update information if we have an IPv6 address.
+               if myipv6:
+                       data["myipv6"] = myipv6
 
                return data
 
@@ -598,7 +600,7 @@ class DDNSProviderEntryDNS(DDNSProvider):
 
                # Send update to the server.
                try:
-                       response = self.send_request(url, method="PUT", data=data)
+                       response = self.send_request(url, data=data)
 
                # Handle error codes
                except urllib2.HTTPError, e: