]> git.ipfire.org Git - oddments/ddns.git/blobdiff - src/ddns/providers.py
More HTTP status code fixes.
[oddments/ddns.git] / src / ddns / providers.py
index 21159727ad989ca297604ed1574af78901d6568d..8576c9bccae0838c991478c83b406d079adc56d3 100644 (file)
@@ -115,9 +115,12 @@ class DDNSProvider(object):
        def protocols(self):
                return self.INFO.get("protocols")
 
        def protocols(self):
                return self.INFO.get("protocols")
 
-       def __call__(self):
+       def __call__(self, force=False):
+               if force:
+                       logger.info(_("Updating %s forced") % self.hostname)
+
                # Check if we actually need to update this host.
                # Check if we actually need to update this host.
-               if self.is_uptodate(self.protocols):
+               elif self.is_uptodate(self.protocols):
                        logger.info(_("%s is already up to date") % self.hostname)
                        return
 
                        logger.info(_("%s is already up to date") % self.hostname)
                        return
 
@@ -192,7 +195,7 @@ class DDNSProviderDHS(DDNSProvider):
                        return
 
                # Handle error codes.
                        return
 
                # Handle error codes.
-               elif response.code == "401":
+               elif response.code == 401:
                        raise DDNSAuthenticationError
 
                # If we got here, some other update error happened.
                        raise DDNSAuthenticationError
 
                # If we got here, some other update error happened.