From fbde04178a68b3e785785c7b793c2362f45cd457 Mon Sep 17 00:00:00 2001 From: Ken Raffenetti Date: Tue, 5 Sep 2006 20:40:06 +0000 Subject: minor formatting, add scotty to list of dhcp servers git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2215 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Plugins/Hostbase.py | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/lib/Server/Plugins/Hostbase.py b/src/lib/Server/Plugins/Hostbase.py index d40291063..27fe98ef7 100644 --- a/src/lib/Server/Plugins/Hostbase.py +++ b/src/lib/Server/Plugins/Hostbase.py @@ -56,7 +56,7 @@ class Hostbase(Plugin): ## raise PluginInitError self.filedata = {} self.dnsservers = [] - self.dhcpservers = [] + self.dhcpservers = ['scotty'] self.templates = {'zone':Template(open(self.data + '/templates/' + 'zone.tmpl').read()), 'reversesoa':Template(open(self.data + '/templates/' + 'reversesoa.tmpl').read()), 'named':Template(open(self.data + '/templates/' + 'named.tmpl').read()), @@ -67,8 +67,11 @@ class Hostbase(Plugin): } self.Entries['ConfigFile'] = {} self.__rmi__ = ['rebuildState'] - self.rebuildState() - + try: + self.rebuildState() + except: + raise PluginInitError + def FetchFile(self, entry, metadata): '''Return prebuilt file data''' fname = entry.get('name').split('/')[-1] @@ -94,10 +97,7 @@ class Hostbase(Plugin): def rebuildState(self): '''Pre-cache all state information for hostbase config files''' - try: - from django.db import connection - except: - raise PluginInitError + from django.db import connection cursor = connection.cursor() cursor.execute("SELECT id, serial FROM hostbase_zone") @@ -432,16 +432,16 @@ Name Room User Type from django.db import connection header = """+@machines - +@all-machines - achilles.ctd.anl.gov - raven.ops.anl.gov - seagull.hr.anl.gov - parrot.ops.anl.gov - condor.ops.anl.gov - delphi.esh.anl.gov - anlcv1.ctd.anl.gov - anlvms.ctd.anl.gov - olivia.ctd.anl.gov\n\n""" ++@all-machines +achilles.ctd.anl.gov +raven.ops.anl.gov +seagull.hr.anl.gov +parrot.ops.anl.gov +condor.ops.anl.gov +delphi.esh.anl.gov +anlcv1.ctd.anl.gov +anlvms.ctd.anl.gov +olivia.ctd.anl.gov\n\n""" cursor = connection.cursor() cursor.execute(""" -- cgit v1.2.3-1-g7c22