def __call__(self, force=False):
if force:
- logger.info(_("Updating %s forced") % self.hostname)
+ logger.debug(_("Updating %s forced") % self.hostname)
# Check if we actually need to update this host.
elif self.is_uptodate(self.protocols):
- logger.info(_("%s is already up to date") % self.hostname)
+ logger.debug(_("%s is already up to date") % self.hostname)
return
# Execute the update.
"""
return self.core.system.send_request(*args, **kwargs)
- def get_address(self, proto):
+ def get_address(self, proto, default=None):
"""
Proxy method to get the current IP address.
"""
- return self.core.system.get_address(proto)
+ return self.core.system.get_address(proto) or default
class DDNSProviderAllInkl(DDNSProvider):
elif "is an invalid IP address" in output:
raise DDNSRequestError(_("Invalid IP address has been sent."))
+ # If we got here, some other update error happened.
+ raise DDNSUpdateError
+
class DDNSProviderLightningWireLabs(DDNSProvider):
handle = "dns.lightningwirelabs.com"
- name = "Lightning Wire Labs"
+ name = "Lightning Wire Labs DNS Service"
website = "http://dns.lightningwirelabs.com/"
# Information about the format of the HTTPS request is to be found
def update(self):
data = {
"hostname" : self.hostname,
+ "address6" : self.get_address("ipv6", "-"),
+ "address4" : self.get_address("ipv4", "-"),
}
- # Check if we update an IPv6 address.
- address6 = self.get_address("ipv6")
- if address6:
- data["address6"] = address6
-
- # Check if we update an IPv4 address.
- address4 = self.get_address("ipv4")
- if address4:
- data["address4"] = address4
-
- # Raise an error if none address is given.
- if not data.has_key("address6") and not data.has_key("address4"):
- raise DDNSConfigurationError
-
# Check if a token has been set.
if self.token:
data["token"] = self.token