summaryrefslogtreecommitdiffstats
path: root/src/lib/Server
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-04-25 12:23:31 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-04-25 12:23:31 +0000
commit31733381b3c2479f79a32a9ecab3ea7ded4d0e8b (patch)
tree9362aada7b361385c80f916495348d07664a63e6 /src/lib/Server
parentfbfe78fdca2b417844a2c70fcf0cb460c1655fcd (diff)
downloadbcfg2-31733381b3c2479f79a32a9ecab3ea7ded4d0e8b.tar.gz
bcfg2-31733381b3c2479f79a32a9ecab3ea7ded4d0e8b.tar.bz2
bcfg2-31733381b3c2479f79a32a9ecab3ea7ded4d0e8b.zip
auto-reformat server fingerprint if needed (Resolves Ticket #546)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4560 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server')
-rw-r--r--src/lib/Server/Admin/Client.py13
-rw-r--r--src/lib/Server/Plugins/Metadata.py4
2 files changed, 11 insertions, 6 deletions
diff --git a/src/lib/Server/Admin/Client.py b/src/lib/Server/Admin/Client.py
index 682c12013..9d75a6ab3 100644
--- a/src/lib/Server/Admin/Client.py
+++ b/src/lib/Server/Admin/Client.py
@@ -7,10 +7,15 @@ class Client(Bcfg2.Server.Admin.Mode):
__longhelp__ = __shorthelp__ + '\n\tCreate or delete client entries'
def __init__(self):
Bcfg2.Server.Admin.Mode.__init__(self)
- self.tree = lxml.etree.parse(self.get_repo_path() + \
- '/Metadata/clients.xml')
- self.root = self.tree.getroot()
-
+ try:
+ self.bcore = Bcfg2.Server.Core.Core(self.repo, [], ['Metadata'],
+ 'foo', False)
+ except Bcfg2.Server.Core.CoreInitError, msg:
+ self.errExit("Core load failed because %s" % msg)
+ [bcore.fam.Service() for _ in range(5)]
+ while bcore.fam.Service():
+ pass
+
def __call__(self, args):
Bcfg2.Server.Admin.Mode.__call__(self, args)
if args[0] == 'add':
diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py
index beaa1cc81..25a6bad1e 100644
--- a/src/lib/Server/Plugins/Metadata.py
+++ b/src/lib/Server/Plugins/Metadata.py
@@ -31,7 +31,7 @@ class ClientMetadata(object):
class ProbeSet(Bcfg2.Server.Plugin.EntrySet):
def __init__(self, path, fam):
- fpattern = '[A-Za-z]+'
+ fpattern = '[A-Za-z_\-]+'
Bcfg2.Server.Plugin.EntrySet.__init__(self, fpattern, path, True,
Bcfg2.Server.Plugin.SpecificData)
fam.AddMonitor(path, self)
@@ -262,7 +262,7 @@ class Metadata(Bcfg2.Server.Plugin.Plugin):
try:
datafile = open("%s/%s" % (self.data, 'probed.xml'), 'w')
except IOError:
- self.logger.error("Failed to write clients.xml")
+ self.logger.error("Failed to write probed.xml")
raise MetadataRuntimeError
datafile.write(data)
self.pdirty = False