summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Base.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2011-05-10 11:24:28 -0500
committerNarayan Desai <desai@mcs.anl.gov>2011-05-10 11:24:28 -0500
commit0e75875e9bd9900a6a3c7ab118c448e48829eaef (patch)
tree391204747f48598c4e978d3724afbd5b8aa1d12c /src/lib/Server/Plugins/Base.py
parentf2d218ccd2de93ef639347933ba127ef081b4401 (diff)
parent91634f9a3b888eee3cd5f9a777fcb075fc666c9a (diff)
downloadbcfg2-0e75875e9bd9900a6a3c7ab118c448e48829eaef.tar.gz
bcfg2-0e75875e9bd9900a6a3c7ab118c448e48829eaef.tar.bz2
bcfg2-0e75875e9bd9900a6a3c7ab118c448e48829eaef.zip
Merge branch 'master' of git.mcs.anl.gov:bcfg2
Diffstat (limited to 'src/lib/Server/Plugins/Base.py')
-rw-r--r--src/lib/Server/Plugins/Base.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/Server/Plugins/Base.py b/src/lib/Server/Plugins/Base.py
index 8e5ca1cd9..5e7d89727 100644
--- a/src/lib/Server/Plugins/Base.py
+++ b/src/lib/Server/Plugins/Base.py
@@ -1,9 +1,15 @@
"""This module sets up a base list of configuration entries."""
__revision__ = '$Revision$'
-import Bcfg2.Server.Plugin
import copy
import lxml.etree
+import sys
+# py3k compatibility
+if sys.hexversion >= 0x03000000:
+ from functools import reduce
+
+import Bcfg2.Server.Plugin
+
class Base(Bcfg2.Server.Plugin.Plugin,
Bcfg2.Server.Plugin.Structure,
@@ -31,8 +37,8 @@ class Base(Bcfg2.Server.Plugin.Plugin,
def BuildStructures(self, metadata):
"""Build structures for client described by metadata."""
ret = lxml.etree.Element("Independent", version='2.0')
- fragments = reduce(lambda x, y: x+y,
+ fragments = reduce(lambda x, y: x + y,
[base.Match(metadata) for base
- in self.entries.values()], [])
+ in list(self.entries.values())], [])
[ret.append(copy.deepcopy(frag)) for frag in fragments]
return [ret]