summaryrefslogtreecommitdiffstats
path: root/src/lib/Server
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/Server')
-rw-r--r--src/lib/Server/Core.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py
index e82e05a89..4018c92ef 100644
--- a/src/lib/Server/Core.py
+++ b/src/lib/Server/Core.py
@@ -7,12 +7,15 @@ import lxml.etree
import select
import threading
import time
-import xmlrpclib
from Bcfg2.Component import Component, exposed
from Bcfg2.Server.Plugin import PluginInitError, PluginExecutionError
import Bcfg2.Server.FileMonitor
import Bcfg2.Server.Plugins.Metadata
+# Compatibility imports
+from Bcfg2.Bcfg2Py3k import xmlrpclib
+if sys.hexversion >= 0x03000000:
+ from functools import reduce
logger = logging.getLogger('Bcfg2.Server.Core')
@@ -142,7 +145,7 @@ class Core(Component):
try:
mod = getattr(__import__("Bcfg2.Server.Plugins.%s" %
(plugin)).Server.Plugins, plugin)
- except ImportError, e:
+ except ImportError:
try:
mod = __import__(plugin)
except:
@@ -177,7 +180,8 @@ class Core(Component):
plugin.validate_structures(metadata, data)
elif base_cls == Bcfg2.Server.Plugin.GoalValidator:
plugin.validate_goals(metadata, data)
- except Bcfg2.Server.Plugin.ValidationError, err:
+ except Bcfg2.Server.Plugin.ValidationError:
+ err = sys.exc_info()[1]
logger.error("Plugin %s structure validation failed: %s" \
% (plugin.name, err.message))
raise