]> git.ipfire.org Git - ddns.git/commitdiff
nsupdate.info: Don't repeat failed updates
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 29 Sep 2014 14:10:09 +0000 (14:10 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 29 Sep 2014 14:10:09 +0000 (14:10 +0000)
As requested by Thomas Waldmann <twaldmann@thinkmo.de>
from nsupdate.info (#10603)

src/ddns/providers.py

index 16a6e7b84a12e61626daae02114dfa88fa168690..1e88995962d8343288a582084d3012833f6ee355 100644 (file)
@@ -223,6 +223,14 @@ class DDNSProvider(object):
                if not last_status == "failure":
                        return False
 
                if not last_status == "failure":
                        return False
 
+               # If there is no holdoff time, we won't update ever again.
+               if self.holdoff_failure_days is None:
+                       logger.warning(_("An update has not been performed because earlier updates failed for %s") \
+                               % self.hostname)
+                       logger.warning(_("There will be no retries"))
+
+                       return True
+
                # Determine when the holdoff time ends
                last_update = self.db.last_update(self.hostname, status=last_status)
                holdoff_end = last_update + datetime.timedelta(days=self.holdoff_failure_days)
                # Determine when the holdoff time ends
                last_update = self.db.last_update(self.hostname, status=last_status)
                holdoff_end = last_update + datetime.timedelta(days=self.holdoff_failure_days)
@@ -1051,6 +1059,10 @@ class DDNSProviderNsupdateINFO(DDNSProtocolDynDNS2, DDNSProvider):
        # has not been implemented here, yet.
        can_remove_records = False
 
        # has not been implemented here, yet.
        can_remove_records = False
 
+       # After a failed update, there will be no retries
+       # https://bugzilla.ipfire.org/show_bug.cgi?id=10603
+       holdoff_failure_days = None
+
        # Nsupdate.info uses the hostname as user part for the HTTP basic auth,
        # and for the password a so called secret.
        @property
        # Nsupdate.info uses the hostname as user part for the HTTP basic auth,
        # and for the password a so called secret.
        @property