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/Admin/Snapshots.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/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) |