summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-23 07:58:04 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-23 07:58:04 -0400
commit99fc1b0724ecef423c50bdf13666f6633c3765ef (patch)
treea42a2ba59838296b929829c6a7ac9f94fc5e29af /src
parente9aa3cf5f15e06f3af837792a5fae967514cd0e5 (diff)
downloadbcfg2-99fc1b0724ecef423c50bdf13666f6633c3765ef.tar.gz
bcfg2-99fc1b0724ecef423c50bdf13666f6633c3765ef.tar.bz2
bcfg2-99fc1b0724ecef423c50bdf13666f6633c3765ef.zip
removed or fixed functools imports
Diffstat (limited to 'src')
-rw-r--r--src/lib/Bcfg2/Bcfg2Py3k.py3
-rw-r--r--src/lib/Bcfg2/Server/Core.py5
-rw-r--r--src/lib/Bcfg2/Server/Plugin.py8
-rw-r--r--src/lib/Bcfg2/Server/Plugins/Base.py5
4 files changed, 5 insertions, 16 deletions
diff --git a/src/lib/Bcfg2/Bcfg2Py3k.py b/src/lib/Bcfg2/Bcfg2Py3k.py
index a4441946b..be5175e62 100644
--- a/src/lib/Bcfg2/Bcfg2Py3k.py
+++ b/src/lib/Bcfg2/Bcfg2Py3k.py
@@ -101,8 +101,7 @@ except:
try:
reduce = reduce
except NameError:
- import functools
- reduce = functools.reduce
+ from functools import reduce
try:
from collections import MutableMapping
diff --git a/src/lib/Bcfg2/Server/Core.py b/src/lib/Bcfg2/Server/Core.py
index d518e0e92..f39453edd 100644
--- a/src/lib/Bcfg2/Server/Core.py
+++ b/src/lib/Bcfg2/Server/Core.py
@@ -14,12 +14,9 @@ import Bcfg2.settings
import Bcfg2.Server
import Bcfg2.Logger
import Bcfg2.Server.FileMonitor
-from Bcfg2.Bcfg2Py3k import xmlrpclib
+from Bcfg2.Bcfg2Py3k import xmlrpclib, reduce
from Bcfg2.Server.Plugin import PluginInitError, PluginExecutionError
-if sys.hexversion >= 0x03000000:
- from functools import reduce
-
try:
import psyco
psyco.full()
diff --git a/src/lib/Bcfg2/Server/Plugin.py b/src/lib/Bcfg2/Server/Plugin.py
index f841cef22..822f2894a 100644
--- a/src/lib/Bcfg2/Server/Plugin.py
+++ b/src/lib/Bcfg2/Server/Plugin.py
@@ -10,7 +10,8 @@ import threading
import lxml.etree
import Bcfg2.Server
import Bcfg2.Options
-from Bcfg2.Bcfg2Py3k import ConfigParser, CmpMixin
+from Bcfg2.Bcfg2Py3k import ConfigParser, CmpMixin, reduce, Queue, Empty, \
+ Full, cPickle
try:
import django
@@ -18,11 +19,6 @@ try:
except ImportError:
has_django = False
-# py3k compatibility
-if sys.hexversion >= 0x03000000:
- from functools import reduce
-from Bcfg2.Bcfg2Py3k import Queue, Empty, Full, cPickle
-
# grab default metadata info from bcfg2.conf
opts = {'owner': Bcfg2.Options.MDATA_OWNER,
'group': Bcfg2.Options.MDATA_GROUP,
diff --git a/src/lib/Bcfg2/Server/Plugins/Base.py b/src/lib/Bcfg2/Server/Plugins/Base.py
index 389ca7a95..2020f7795 100644
--- a/src/lib/Bcfg2/Server/Plugins/Base.py
+++ b/src/lib/Bcfg2/Server/Plugins/Base.py
@@ -3,10 +3,7 @@
import copy
import lxml.etree
import sys
-# py3k compatibility
-if sys.hexversion >= 0x03000000:
- from functools import reduce
-
+from Bcfg2.Bcfg2Py3k import reduce
import Bcfg2.Server.Plugin