diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2011-07-21 10:44:06 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2011-07-21 10:44:06 -0500 |
commit | 52f9abbc8171a441a3f85108cc51a1143531c92c (patch) | |
tree | 70663c87724c229828ea201bdb584f5b72fc5930 | |
parent | 494dea763857f784fb789243bda569c5bec0f10a (diff) | |
download | bcfg2-52f9abbc8171a441a3f85108cc51a1143531c92c.tar.gz bcfg2-52f9abbc8171a441a3f85108cc51a1143531c92c.tar.bz2 bcfg2-52f9abbc8171a441a3f85108cc51a1143531c92c.zip |
bcfg2-admin: Revert some changes that are not py3k compatible
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
-rw-r--r-- | src/lib/Server/Admin/Reports.py | 5 | ||||
-rw-r--r-- | src/lib/Server/Admin/Xcmd.py | 5 | ||||
-rwxr-xr-x | src/sbin/bcfg2-admin | 5 |
3 files changed, 10 insertions, 5 deletions
diff --git a/src/lib/Server/Admin/Reports.py b/src/lib/Server/Admin/Reports.py index b4c3b5fcd..3f25f11af 100644 --- a/src/lib/Server/Admin/Reports.py +++ b/src/lib/Server/Admin/Reports.py @@ -28,8 +28,9 @@ import django.core.management # FIXME - settings file uses a hardcoded path for /etc/bcfg2.conf try: import Bcfg2.Server.Reports.settings -except Exception, err: - sys.stderr.write("Failed to load configuration settings. %s\n" % err) +except Exception: + e = sys.exc_info()[1] + sys.stderr.write("Failed to load configuration settings. %s\n" % e) raise SystemExit(1) project_directory = os.path.dirname(Bcfg2.Server.Reports.settings.__file__) diff --git a/src/lib/Server/Admin/Xcmd.py b/src/lib/Server/Admin/Xcmd.py index 6147139fb..8faf68368 100644 --- a/src/lib/Server/Admin/Xcmd.py +++ b/src/lib/Server/Admin/Xcmd.py @@ -1,3 +1,5 @@ +import sys + import Bcfg2.Options import Bcfg2.Proxy import Bcfg2.Server.Admin @@ -40,7 +42,8 @@ class Xcmd(Bcfg2.Server.Admin.Mode): args = tuple(setup['args'][1:]) try: data = getattr(proxy, cmd)(*args) - except xmlrpclib.Fault, flt: + except xmlrpclib.Fault: + flt = sys.exc_info()[1] if flt.faultCode == 7: print("Unknown method %s" % cmd) return diff --git a/src/sbin/bcfg2-admin b/src/sbin/bcfg2-admin index 4c92a0e2e..0056a97aa 100755 --- a/src/sbin/bcfg2-admin +++ b/src/sbin/bcfg2-admin @@ -69,8 +69,9 @@ def main(): raise SystemExit(0) try: mode_cls = mode_import(modname) - except ImportError, err: - log.error("Failed to load admin mode %s: %s" % (modname, err)) + except ImportError: + e = sys.exc_info()[1] + log.error("Failed to load admin mode %s: %s" % (modname, e)) raise SystemExit(1) mode = mode_cls(setup['configfile']) mode(setup['args'][1:]) |