summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndrew Brestick <brestick@mcs.anl.gov>2008-06-23 16:18:04 +0000
committerAndrew Brestick <brestick@mcs.anl.gov>2008-06-23 16:18:04 +0000
commitc746bdc6f47d023ff13fae99f218aac0cd54003e (patch)
tree6696729c06427c60e22a0b53a09fa3ea7ed4002d /src
parentf26f2426d1b73b5bfddaef7b1700201876b64151 (diff)
downloadbcfg2-c746bdc6f47d023ff13fae99f218aac0cd54003e.tar.gz
bcfg2-c746bdc6f47d023ff13fae99f218aac0cd54003e.tar.bz2
bcfg2-c746bdc6f47d023ff13fae99f218aac0cd54003e.zip
Resolves clients.xml overwrite issue in #567, fixes configuration issues with certain bcfg2-admin modes
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4706 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Server/Admin/Fingerprint.py4
-rw-r--r--src/lib/Server/Admin/Minestruct.py4
-rw-r--r--src/lib/Server/Admin/Tidy.py4
-rw-r--r--src/lib/Server/Admin/Viz.py3
-rw-r--r--src/lib/Server/Plugins/Metadata.py5
5 files changed, 19 insertions, 1 deletions
diff --git a/src/lib/Server/Admin/Fingerprint.py b/src/lib/Server/Admin/Fingerprint.py
index bf50f0aaa..aff8d42bf 100644
--- a/src/lib/Server/Admin/Fingerprint.py
+++ b/src/lib/Server/Admin/Fingerprint.py
@@ -7,6 +7,10 @@ class Fingerprint(Bcfg2.Server.Admin.Mode):
'''Produce server key fingerprint'''
__shorthelp__ = 'bcfg2-admin fingerprint'
__longhelp__ = __shorthelp__ + '\n\tPrint the server certificate fingerprint'
+
+ def __init__(self, cfile):
+ Bcfg2.Server.Admin.Mode.__init__(self, cfile)
+
def __call__(self, args):
Bcfg2.Server.Admin.Mode.__call__(self, args)
print self.getFingerprint()
diff --git a/src/lib/Server/Admin/Minestruct.py b/src/lib/Server/Admin/Minestruct.py
index bd251dabf..9e91ff33e 100644
--- a/src/lib/Server/Admin/Minestruct.py
+++ b/src/lib/Server/Admin/Minestruct.py
@@ -4,6 +4,10 @@ class Minestruct(Bcfg2.Server.Admin.Mode):
'''Pull extra entries out of statistics'''
__shorthelp__ = 'bcfg2-admin minestruct <client>'
__longhelp__ = __shorthelp__ + '\n\tExtract extra entry lists from statistics'
+
+ def __init__(self, cfile):
+ Bcfg2.Server.Admin.Mode.__init__(self, cfile)
+
def __call__(self, args):
Bcfg2.Server.Admin.Mode.__call__(self, args)
if len(args) != 1:
diff --git a/src/lib/Server/Admin/Tidy.py b/src/lib/Server/Admin/Tidy.py
index aafd7b9a7..287b34310 100644
--- a/src/lib/Server/Admin/Tidy.py
+++ b/src/lib/Server/Admin/Tidy.py
@@ -4,6 +4,10 @@ import re, os, socket
class Tidy(Bcfg2.Server.Admin.Mode):
__shorthelp__ = 'bcfg2-admin tidy [-f] [-I]'
__longhelp__ = __shorthelp__ + '\n\tClean up useless files in the repo'
+
+ def __init__(self, cfile):
+ Bcfg2.Server.Admin.Mode.__init__(self, cfile)
+
def __call__(self, args):
Bcfg2.Server.Admin.Mode.__call__(self, args)
badfiles = self.buildTidyList()
diff --git a/src/lib/Server/Admin/Viz.py b/src/lib/Server/Admin/Viz.py
index f7daa9453..dfc8b3392 100644
--- a/src/lib/Server/Admin/Viz.py
+++ b/src/lib/Server/Admin/Viz.py
@@ -10,6 +10,9 @@ class Viz(Bcfg2.Server.Admin.Mode):
'indianred1', 'limegreen', 'orange1', 'lightblue2',
'green1', 'blue1', 'yellow1', 'darkturquoise', 'gray66']
+ def __init__(self, cfile):
+ Bcfg2.Server.Admin.Mode.__init__(self, cfile)
+
def __call__(self, args):
Bcfg2.Server.Admin.Mode.__call__(self, args)
# First get options to the 'viz' subcommand
diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py
index 996ba29f6..faa92ef50 100644
--- a/src/lib/Server/Plugins/Metadata.py
+++ b/src/lib/Server/Plugins/Metadata.py
@@ -105,6 +105,7 @@ class Metadata(Bcfg2.Server.Plugin.MetadataPlugin,
self.passwords = {}
self.session_cache = {}
self.clientdata = None
+ self.clientdata_original = None
self.default = None
self.pdirty = False
try:
@@ -137,6 +138,7 @@ class Metadata(Bcfg2.Server.Plugin.MetadataPlugin,
return
included = [ent.get('href') for ent in \
xdata.findall('./{http://www.w3.org/2001/XInclude}include')]
+ xdata_original = copy.deepcopy(xdata)
if included:
for name in included:
if name not in self.extra[dest]:
@@ -154,6 +156,7 @@ class Metadata(Bcfg2.Server.Plugin.MetadataPlugin,
self.secure = []
self.floating = []
self.addresses = {}
+ self.clientdata_original = xdata_original
self.clientdata = xdata
for client in xdata.findall('.//Client'):
clname = client.get('name').lower()
@@ -271,7 +274,7 @@ class Metadata(Bcfg2.Server.Plugin.MetadataPlugin,
fd = datafile.fileno()
while self.locked(fd) == True:
pass
- datafile.write(lxml.etree.tostring(self.clientdata.getroot()))
+ datafile.write(lxml.etree.tostring(self.clientdata_original.getroot()))
fcntl.lockf(fd, fcntl.LOCK_UN)
datafile.close()