Don't log a successful image if no update was performed
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Jul 2014 15:39:36 +0000 (15:39 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 14 Jul 2014 15:39:36 +0000 (15:39 +0000)
When no update is necessary, there should no successful
message be logged.

src/ddns/__init__.py
src/ddns/providers.py

index 4e4093e..22764e6 100644 (file)
@@ -161,7 +161,3 @@ class DDNSCore(object):
                except Exception, e:
                        logger.error(_("Dynamic DNS update for %(hostname)s (%(provider)s) throwed an unhandled exception:") % \
                                { "hostname" : entry.hostname, "provider" : entry.name }, exc_info=True)
-
-               else:
-                       logger.info(_("Dynamic DNS update for %(hostname)s (%(provider)s) successful") % \
-                               { "hostname" : entry.hostname, "provider" : entry.name })
index de87b7c..59ccd72 100644 (file)
@@ -129,12 +129,16 @@ class DDNSProvider(object):
 
                # Check if we actually need to update this host.
                elif self.is_uptodate(self.protocols):
-                       logger.debug(_("%s is already up to date") % self.hostname)
+                       logger.info(_("The dynamic host %(hostname)s (%(provider)s) is already up to date") % \
+                               { "hostname" : self.hostname, "provider" : self.name })
                        return
 
                # Execute the update.
                self.update()
 
+               logger.info(_("Dynamic DNS update for %(hostname)s (%(provider)s) successful") % \
+                       { "hostname" : self.hostname, "provider" : self.name })
+
        def update(self):
                raise NotImplementedError