diff options
author | Sol Jerome <sol.jerome@gmail.com> | 2011-04-26 20:07:47 -0500 |
---|---|---|
committer | Sol Jerome <sol.jerome@gmail.com> | 2011-04-26 20:07:47 -0500 |
commit | 7f68ebb4ce4cb65850a63660f2f1cec06100064a (patch) | |
tree | fb8fb3af8f11c5489315022924cd9d7146a666c0 /src/lib/Server/Admin/Snapshots.py | |
parent | cca5e6a474adf1453408909979143233d54ed2be (diff) | |
download | bcfg2-7f68ebb4ce4cb65850a63660f2f1cec06100064a.tar.gz bcfg2-7f68ebb4ce4cb65850a63660f2f1cec06100064a.tar.bz2 bcfg2-7f68ebb4ce4cb65850a63660f2f1cec06100064a.zip |
Admin: Add full PY3K compatibility
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src/lib/Server/Admin/Snapshots.py')
-rw-r--r-- | src/lib/Server/Admin/Snapshots.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/Server/Admin/Snapshots.py b/src/lib/Server/Admin/Snapshots.py index d58873174..052545b61 100644 --- a/src/lib/Server/Admin/Snapshots.py +++ b/src/lib/Server/Admin/Snapshots.py @@ -8,6 +8,8 @@ import Bcfg2.Server.Snapshots import Bcfg2.Server.Snapshots.model from Bcfg2.Server.Snapshots.model import Snapshot, Client, Metadata, Base, \ File, Group, Package, Service +# Compatibility import +from Bcfg2.Bcfg2Py3k import u_str class Snapshots(Bcfg2.Server.Admin.Mode): __shorthelp__ = "Interact with the Snapshots system" @@ -71,7 +73,7 @@ class Snapshots(Bcfg2.Server.Admin.Mode): session.commit() elif args[0] == 'dump': client = args[1] - snap = Snapshot.get_current(self.session, unicode(client)) + snap = Snapshot.get_current(self.session, u_str(client)) if not snap: print("Current snapshot for %s not found" % client) sys.exit(1) @@ -105,7 +107,7 @@ class Snapshots(Bcfg2.Server.Admin.Mode): print("Usage: bcfg2-admin snapshots -b <client>") return client = args[2] - snap = Snapshot.get_current(self.session, unicode(client)) + snap = Snapshot.get_current(self.session, u_str(client)) if not snap: print("Current snapshot for %s not found" % client) sys.exit(1) @@ -128,7 +130,7 @@ class Snapshots(Bcfg2.Server.Admin.Mode): elif '-e' in args[1:]: # Query a single host for extra entries client = args[2] - snap = Snapshot.get_current(self.session, unicode(client)) + snap = Snapshot.get_current(self.session, u_str(client)) if not snap: print("Current snapshot for %s not found" % client) sys.exit(1) |