diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2011-05-03 14:06:26 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2011-05-03 14:06:26 -0500 |
commit | 136d7397a067d815d986b49e06d6d3217fdb18f8 (patch) | |
tree | 2decb82d93bdd67365162ddfcbb472caffdbbd06 /src/lib/Server/Core.py | |
parent | 20ed074b7a05b8b3817b1ca9a11d8a4b09b719ce (diff) | |
parent | 71a026b3b7c13fdf242d387b255d6e0daefce0ca (diff) | |
download | bcfg2-136d7397a067d815d986b49e06d6d3217fdb18f8.tar.gz bcfg2-136d7397a067d815d986b49e06d6d3217fdb18f8.tar.bz2 bcfg2-136d7397a067d815d986b49e06d6d3217fdb18f8.zip |
Merge branch 'py3k'
Diffstat (limited to 'src/lib/Server/Core.py')
-rw-r--r-- | src/lib/Server/Core.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/Server/Core.py b/src/lib/Server/Core.py index e82e05a89..ac0a51e23 100644 --- a/src/lib/Server/Core.py +++ b/src/lib/Server/Core.py @@ -5,14 +5,18 @@ import atexit import logging import lxml.etree import select +import sys 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 +146,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 +181,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 |