From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: ddns@lists.ipfire.org Subject: Re: [PATCH 1/2] Add new provider Servercow Date: Mon, 13 Feb 2017 13:01:08 +0000 Message-ID: <1486990868.24657.143.camel@ipfire.org> In-Reply-To: <1486737359-22481-1-git-send-email-jonatan.schlag@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4729249874427512775==" List-Id: --===============4729249874427512775== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Hello Jonatan, thanks for sending in this patch. I have seen this work already, so I ACK this patch. Reviewed-by: Michael Tremer Good work! Best, -Michael On Fri, 2017-02-10 at 15:35 +0100, Jonatan Schlag wrote: > Tested-by: Jonatan Schlag > Signed-off-by: Jonatan Schlag > --- >  src/ddns/providers.py | 35 +++++++++++++++++++++++++++++++++++ >  1 file changed, 35 insertions(+) > > diff --git a/src/ddns/providers.py b/src/ddns/providers.py > index 2c30d42..01d7827 100644 > --- a/src/ddns/providers.py > +++ b/src/ddns/providers.py > @@ -1452,6 +1452,41 @@ class DDNSProviderSelfhost(DDNSProtocolDynDNS2, > DDNSProvider): >   return data >   >   > +class DDNSProviderServercow(DDNSProvider): > + handle    = "servercow.de" > + name      = "servercow.de" > + website   = "https://servercow.de/" > + protocols = ("ipv4", "ipv6") > + > + url = "https://www.servercow.de/dnsupdate/update.php" > + can_remove_records = False > + > + def update_protocol(self, proto): > + data = { > + "ipaddr"   : self.get_address(proto), > + "hostname" : self.hostname, > + "username" : self.username, > + "pass"     : self.password, > + } > + > + # Send request to provider > + response = self.send_request(self.url, data=data) > + > + # Read response > + output = response.read() > + > + # Server responds with OK if update was successful > + if output.startswith("OK"): > + return > + > + # Catch any errors > + elif output.startswith("FAILED - Authentication failed"): > + raise DDNSAuthenticationError > + > + # If we got here, some other update error happened > + raise DDNSUpdateError(output) > + > + >  class DDNSProviderSPDNS(DDNSProtocolDynDNS2, DDNSProvider): >   handle    = "spdns.org" >   name      = "SPDYN" --===============4729249874427512775== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KVmVyc2lvbjogR251UEcgdjIKCmlRSWNCQUFC Q2dBR0JRSllvYTRVQUFvSkVJQjU4UDl2a0FrSGM1a1FBSlVkYWUwMDR6Uzh2a3RDTCt5TVFYRE4K a1dQYmI5RnltZkY4NVltM3Q3cVJMQ1NvblFNb09nMFB4Tnd5VGp0dkIxc1QvT2J1bCtDaHh1SUtF Vzh3QSsvdQpSZTgyOWxvUENHL1VUUjZadHJGVEp0QlVXR3lEY1N0MHhvbnRjSUkxSUlROVJRdzJD d2xrYloweGhHbHd1eFc1CmRBclVjZTFpTGtVQWZORFd3bnR1QWtURkNvVW9NUDRCY3l3bTNubFFX WitJOC9IR00xcEpFWXJZVUhTeUtSeGYKQmVRM2IvdzhLckxEbUMvWUc1ejhGRGUwWC8xc2VMNHpK QXFpRTNpbU9lcVN5NldMNW9DWXpYb3BMTXlzYm1ldQprM2tlc0syYTlpRW5wSGlXWHVNYVRwSmEr UlBHU1dDYzBjYVhCenRGR0diUnlGMGNnYk02WHpCbkQ3R1BhanJQCm1QYXZMSGEvUE9WRm82NXkx d1UrZytpeitHa3VCOUd6ZE9BWXZFaHhwYmpBUmxnSWdWVEFuUlR1ODZRMVVPb2gKNGJ5aTAvdnpi amdnSld2RjhRekVyWVB6ZmovUkhmak04MGFJNzdKdzBocDZnZm1RV1JJd09wYUlYMkhBaUVTNwov cXlWNGp3WjNBVXN4bE4ra3prTVRxNVF5aE1VeFhTRUhYUkc0VmFUa3Y2K3R0TmtQSXlXak5lbmFo OVB5QUhpCk0wdzlSckQzZWRNVUpLcW5McmZLL0x1QVBnQ0tmbXcxNzk1bUFqcjl3QlZtN1dTZlJL alp2K1M4Ylp2UUVld2QKVDZ2U2xKU09yQjNBY2NtUzdHQU5pRlF4TGxhVlRaVmN0OVF2eVE3VmJR TURhb0VpemtuWHNYSnVXS3NzUzRQcgpMbEJ5Vm16dC9qL0xiQWR4V2RDOQo9WkF6UAotLS0tLUVO RCBQR1AgU0lHTkFUVVJFLS0tLS0K --===============4729249874427512775==--