diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2004-08-03 21:42:16 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2004-08-03 21:42:16 +0000 |
commit | 6828f59d5f01d594a3ae570d8a69273ff09f6b71 (patch) | |
tree | 1970989d88df6d301bd7baf1504fc3647a0457be /src/BcfgServer.py | |
parent | 1857219859195cf3644c2f5e56207038b4552e14 (diff) | |
download | bcfg2-6828f59d5f01d594a3ae570d8a69273ff09f6b71.tar.gz bcfg2-6828f59d5f01d594a3ae570d8a69273ff09f6b71.tar.bz2 bcfg2-6828f59d5f01d594a3ae570d8a69273ff09f6b71.zip |
updates
(Logical change 1.25)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@125 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/BcfgServer.py')
-rw-r--r-- | src/BcfgServer.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/BcfgServer.py b/src/BcfgServer.py index 8a403ac5a..81fe72818 100644 --- a/src/BcfgServer.py +++ b/src/BcfgServer.py @@ -1,6 +1,9 @@ #!/usr/bin/env python # $Id: $ +from syslog import syslog, LOG_INFO +from time import time + from elementtree.ElementTree import Element, tostring from Bcfg2.Core import Core @@ -11,7 +14,8 @@ from sss.server import Server class MetadataStore(object): def __init__(self): - self.images = {'topaz':'debian-3.1'} + self.classes = {} + self.images = {'debian-3.1':['topaz']} self.tags = {'laptop':['topaz']} self.bundles = {'global':['ssh'], 'tags':{'laptop':[]}, 'hosts':{}} @@ -39,15 +43,17 @@ class BcfgServer(Server): return 1 def BuildConfig(self, xml, (peer,port)): + t = time() # get metadata for host config = Element("Configuration", version='2.0') - m = Metadata(False, 'chiba-rh73', ['ssh'], [], 'topaz') + m = Metadata(False, 'chiba-rh73', [], ['ssh'], [], 'topaz') structures = self.core.GetStructures(m) - # for s in structures: - # self.core.BindStructure(s, m) - # config.append(s) - # for x in s.getchildren(): - # print x.attrib['name'], '\000' in tostring(x) + for s in structures: + self.core.BindStructure(s, m) + config.append(s) + #for x in s.getchildren(): + # print x.attrib['name'], '\000' in tostring(x) + syslog(LOG_INFO, "Generated config for %s in %s seconds"%(peer, time()-t)) return config def GetProbes(self, xml, (peer,port)): |