From c4cafdbc76295d72caa4119be707b5acd1d00796 Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Mon, 10 Dec 2012 15:58:39 -0500 Subject: Make DNS drivers inherit interface. Updates the DNS driver implementations so they inherit the interface. Should help catch things that aren't implemented in the future. Change-Id: Ic8b269c8525236c65b492c889d4530a09836bb13 --- nova/network/ldapdns.py | 3 ++- nova/network/minidns.py | 4 +++- nova/network/noop_dns_driver.py | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) (limited to 'nova') diff --git a/nova/network/ldapdns.py b/nova/network/ldapdns.py index affa976f0..c5ae62899 100644 --- a/nova/network/ldapdns.py +++ b/nova/network/ldapdns.py @@ -16,6 +16,7 @@ import ldap import time from nova import exception +from nova.network import dns_driver from nova.openstack.common import cfg from nova.openstack.common import log as logging from nova import utils @@ -300,7 +301,7 @@ class HostEntry(DNSEntry): parent = property(_parent) -class LdapDNS(object): +class LdapDNS(dns_driver.DNSDriver): """Driver for PowerDNS using ldap as a back end. This driver assumes ldap-method=strict, with all domains diff --git a/nova/network/minidns.py b/nova/network/minidns.py index a008c5c36..435cca3b7 100644 --- a/nova/network/minidns.py +++ b/nova/network/minidns.py @@ -17,14 +17,16 @@ import shutil import tempfile from nova import exception +from nova.network import dns_driver from nova.openstack.common import cfg from nova.openstack.common import log as logging + CONF = cfg.CONF LOG = logging.getLogger(__name__) -class MiniDNS(object): +class MiniDNS(dns_driver.DNSDriver): """ Trivial DNS driver. This will read/write to a local, flat file and have no effect on your actual DNS system. This class is strictly for testing purposes, and should keep you out of dependency diff --git a/nova/network/noop_dns_driver.py b/nova/network/noop_dns_driver.py index 82ca0fb2f..23d1d1f3e 100644 --- a/nova/network/noop_dns_driver.py +++ b/nova/network/noop_dns_driver.py @@ -15,7 +15,10 @@ # under the License. -class NoopDNSDriver(object): +from nova.network import dns_driver + + +class NoopDNSDriver(dns_driver.DNSDriver): """ No-op DNS manager. Does nothing. """ def __init__(self): -- cgit