# Python
AM_PATH_PYTHON([2.7])
-# BIND nsupdate
-AC_CHECK_TOOL([NSUPDATE], [nsupdate])
-if test -z "${NSUPDATE}"; then
- AC_MSG_ERROR([*** nsupdate not found])
-fi
-
save_LIBS="$LIBS"
AC_CONFIG_FILES([
prefix : ${prefix}
sysconfdir : ${sysconfdir}
-
- nsupdate : ${NSUPDATE}
])
logger.warning("Could not find provider '%s' for entry '%s'." % (provider, entry))
continue
+ # Check if the provider is actually supported and if there are
+ # some dependencies missing on this system.
+ if not provider.supported():
+ logger.warning("Provider '%s' is known, but not supported on this machine" % (provider.name))
+ continue
+
# Create an instance of the provider object with settings from the
# configuration file.
entry = provider(self, **settings)
import datetime
import logging
+import os
import subprocess
import urllib2
import xml.dom.minidom
_providers[provider.handle] = provider
+ @staticmethod
+ def supported():
+ """
+ Should be overwritten to check if the system the code is running
+ on has all the required tools to support this provider.
+ """
+ return True
+
def __init__(self, core, **settings):
self.core = core
DEFAULT_TTL = 60
+ @staticmethod
+ def supported():
+ # Search if the nsupdate utility is available
+ paths = os.environ.get("PATH")
+
+ for path in paths.split(":"):
+ executable = os.path.join(path, "nsupdate")
+
+ if os.path.exists(executable):
+ return True
+
+ return False
+
def update(self):
scriptlet = self.__make_scriptlet()