summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2005-04-11 17:54:33 +0000
committerNarayan Desai <desai@mcs.anl.gov>2005-04-11 17:54:33 +0000
commit6a402132b5e3c74b8ed7b779ecfbab0d87fb7346 (patch)
tree25e0970ac9de83118c118660d573b771a164156f /src
parent4a251957c689e6ffb58c654ac6430e59108d8b86 (diff)
downloadbcfg2-6a402132b5e3c74b8ed7b779ecfbab0d87fb7346.tar.gz
bcfg2-6a402132b5e3c74b8ed7b779ecfbab0d87fb7346.tar.bz2
bcfg2-6a402132b5e3c74b8ed7b779ecfbab0d87fb7346.zip
Delete: src/lib/Server/Generators/Debconf.py
}(Logical change 1.220) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@920 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Generators/Debconf.py59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/lib/Server/Generators/Debconf.py b/src/lib/Server/Generators/Debconf.py
deleted file mode 100644
index 9156e5d6d..000000000
--- a/src/lib/Server/Generators/Debconf.py
+++ /dev/null
@@ -1,59 +0,0 @@
-'''this generator handles production of client-specific debconf files'''
-__revision__ = '$Revision$'
-
-from Bcfg2.Server.Generator import Generator, DirectoryBacked
-from elementtree.ElementTree import Element
-
-class Debconf(Generator):
- '''Debconf takes <data>/template.dat and adds entries for
- -> hostname
- -> video driver'''
- __name__ = 'Debconf'
- __version__ = '$Id$'
- __author__ = 'bcfg-dev@mcs.anl.gov'
- __provides__ = {'ConfigFile':{}}
-
- probes = [Element("probe", name='VGA', interpreter='/bin/sh', source=__name__)]
- probes[0].text = '''
- XSERVER='/usr/bin/X11/X|/usr/X11R6/bin/X'
- if [ XFree86 -configure 2>/dev/null ] ; then
- VGACARD=`tail -50 /root/XF86Config.new | grep Driver | awk -F'"' '{print $2}'`
- elif ps auxww | egrep ${XSERVER} | grep -v grep > /dev/null ;then
- if [ -e /etc/X11/XF86Config ]; then
- VGACARD=`tail -50 /etc/X11/XF86Config | grep Driver | awk -F'"' '{print $2}'`
- else
- VGACARD=`tail -50 /etc/X11/XF86Config-4 | grep Driver | awk -F'"' '{print $2}'`
- fi
- else
- VGACARD=nv
- fi
- echo ${VGACARD}
- '''
-
- def __init__(self, core, datastore):
- Generator.__init__(self, core, datastore)
- self.__provides__['ConfigFile']['/var/spool/debconf/config.dat'] = self.build_config_dat
- self.repo = DirectoryBacked(self.data, self.core.fam)
- self.xsensed = {}
-
- def build_config_dat(self, entry, metadata):
- '''build debconf file for client'''
- entry.attrib['owner'] = 'root'
- entry.attrib['group'] = 'root'
- entry.attrib['perms'] = '0600'
- filedata = self.repo.entries['config.dat']
- xdriver = self.xsensed.get(metadata.hostname, "nv")
- entry.text = filedata % (metadata.hostname, xdriver)
-
- def get_probes(self, metadata):
- '''Send out X probe'''
- return self.probes
-
- def accept_probe_data(self, client, probedata):
- '''Stash probe data for later use'''
- if probedata.attrib['name'] == "VGA":
- self.xsensed[client] = probedata.text
-
-
-
-