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()