X-Git-Url: http://git.ipfire.org/?p=oddments%2Fddns.git;a=blobdiff_plain;f=src%2Fddns%2F__init__.py;h=74be346ed7628ef77d042cc3aa27e471446667c7;hp=2fb5e021e969f56ed4570b4ca4fc78ad6a90ebda;hb=1b8c6925b932ebb24b68fd4ec756c58baed2f306;hpb=0b5e00a20faa4789bf4f241b1147ba8f6c0a031c diff --git a/src/ddns/__init__.py b/src/ddns/__init__.py index 2fb5e02..74be346 100644 --- a/src/ddns/__init__.py +++ b/src/ddns/__init__.py @@ -133,17 +133,28 @@ class DDNSCore(object): if not entry in self.entries: self.entries.append(entry) - def updateall(self, force=False): + def updateone(self, hostname, **kwargs): + for entry in self.entries: + if not entry.hostname == hostname: + continue + + return self._update(entry, **kwargs) + + raise DDNSHostNotFoundError(hostname) + + def updateall(self, **kwargs): + """ + Update all configured entries. + """ # If there are no entries, there is nothing to do. if not self.entries: logger.debug(_("Found no entries in the configuration file. Exiting.")) return - # Update them all. for entry in self.entries: - self.update(entry, force=force) + self._update(entry, **kwargs) - def update(self, entry, force=False): + def _update(self, entry, force=False): try: entry(force=force)