]> git.ipfire.org Git - ddns.git/commitdiff
Update providers so they don't need to format the request URL.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 9 Jun 2014 11:42:48 +0000 (13:42 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 9 Jun 2014 11:42:48 +0000 (13:42 +0200)
ddns/providers.py

index f764001a3eaf9b2fca7d72e868f7180e0433c427..124cf2f8280e7618759725d733b0d3573492025a 100644 (file)
@@ -133,18 +133,21 @@ class DDNSProviderNOIP(DDNSProvider):
        # here: http://www.no-ip.com/integrate/request and
        # here: http://www.no-ip.com/integrate/response
 
        # here: http://www.no-ip.com/integrate/request and
        # here: http://www.no-ip.com/integrate/response
 
-       url = "http://%(username)s:%(password)s@dynupdate.no-ip.com/nic/update?hostname=%(hostname)s&myip=%(address)s"
+       url = "http://%(username)s:%(password)s@dynupdate.no-ip.com/nic/update"
 
        def __call__(self):
                url = self.url % {
 
        def __call__(self):
                url = self.url % {
-                       "hostname" : self.hostname,
                        "username" : self.username,
                        "password" : self.password,
                        "username" : self.username,
                        "password" : self.password,
+               }
+
+               data = {
+                       "hostname" : self.hostname,
                        "address"  : self.get_address("ipv4"),
                }
 
                # Send update to the server.
                        "address"  : self.get_address("ipv4"),
                }
 
                # Send update to the server.
-               response = self.send_request(url)
+               response = self.send_request(url, data=data)
 
                # Get the full response message.
                output = response.read()
 
                # Get the full response message.
                output = response.read()
@@ -173,12 +176,16 @@ class DDNSProviderSelfhost(DDNSProvider):
                "protocols" : ["ipv4",],
        }
 
                "protocols" : ["ipv4",],
        }
 
-       url = "https://carol.selfhost.de/update?username=%(username)s&password=%(password)s&textmodi=1"
+       url = "https://carol.selfhost.de/update"
 
        def __call__(self):
 
        def __call__(self):
-               url = self.url % { "username" : self.username, "password" : self.password }
+               data = {
+                       "username" : self.username,
+                       "password" : self.password,
+                       "textmodi" : "1",
+               }
 
 
-               response = self.send_request(url)
+               response = self.send_request(self.url, data=data)
 
                match = re.search("status=20(0|4)", response.read())
                if not match:
 
                match = re.search("status=20(0|4)", response.read())
                if not match: