summaryrefslogtreecommitdiffstats
path: root/src/sbin/bcfg2-admin
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2011-05-03 14:06:26 -0500
committerSol Jerome <sol.jerome@gmail.com>2011-05-03 14:06:26 -0500
commit136d7397a067d815d986b49e06d6d3217fdb18f8 (patch)
tree2decb82d93bdd67365162ddfcbb472caffdbbd06 /src/sbin/bcfg2-admin
parent20ed074b7a05b8b3817b1ca9a11d8a4b09b719ce (diff)
parent71a026b3b7c13fdf242d387b255d6e0daefce0ca (diff)
downloadbcfg2-136d7397a067d815d986b49e06d6d3217fdb18f8.tar.gz
bcfg2-136d7397a067d815d986b49e06d6d3217fdb18f8.tar.bz2
bcfg2-136d7397a067d815d986b49e06d6d3217fdb18f8.zip
Merge branch 'py3k'
Diffstat (limited to 'src/sbin/bcfg2-admin')
-rwxr-xr-xsrc/sbin/bcfg2-admin10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/sbin/bcfg2-admin b/src/sbin/bcfg2-admin
index 2c9a43859..36be6ab14 100755
--- a/src/sbin/bcfg2-admin
+++ b/src/sbin/bcfg2-admin
@@ -2,11 +2,12 @@
"""bcfg2-admin is a script that helps to administrate a Bcfg2 deployment."""
from optparse import OptionParser
-from StringIO import StringIO
import logging
import Bcfg2.Server.Core
import Bcfg2.Logger
import Bcfg2.Options
+# Compatibility import
+from Bcfg2.Bcfg2Py3k import StringIO
log = logging.getLogger('bcfg2-admin')
@@ -56,14 +57,15 @@ def main():
else:
# Print short help for all modes
parser.print_help()
- print create_description()
+ print(create_description())
raise SystemExit(0)
if args[0] in get_modes():
modname = args[0].capitalize()
try:
mode_cls = mode_import(modname)
- except ImportError, e:
+ except ImportError:
+ e = sys.exc_info()[1]
log.error("Failed to load admin mode %s: %s" % (modname, e))
raise SystemExit(1)
mode = mode_cls(options.configfile)
@@ -73,7 +75,7 @@ def main():
else:
log.error("Unknown mode %s" % args[0])
parser.print_help()
- print create_description()
+ print(create_description())
raise SystemExit(1)
if __name__ == '__main__':