diff options
author | Sol Jerome <solj@ices.utexas.edu> | 2009-04-15 00:18:04 +0000 |
---|---|---|
committer | Sol Jerome <solj@ices.utexas.edu> | 2009-04-15 00:18:04 +0000 |
commit | 48705b803480b14d9fd3d6903b111e6d46aa65d0 (patch) | |
tree | 9953a9aed01346fd234467064ddf707ca0877f99 | |
parent | 9ddfb2541c83795a725c23cb30ec2459196729de (diff) | |
download | bcfg2-48705b803480b14d9fd3d6903b111e6d46aa65d0.tar.gz bcfg2-48705b803480b14d9fd3d6903b111e6d46aa65d0.tar.bz2 bcfg2-48705b803480b14d9fd3d6903b111e6d46aa65d0.zip |
Add revision to bcfg2-admin snapshots reports
Signed-off-by: Sol Jerome <solj@ices.utexas.edu>
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5164 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r-- | src/lib/Server/Admin/Snapshots.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/Server/Admin/Snapshots.py b/src/lib/Server/Admin/Snapshots.py index 6efbea9cb..bc4aafcb6 100644 --- a/src/lib/Server/Admin/Snapshots.py +++ b/src/lib/Server/Admin/Snapshots.py @@ -16,7 +16,7 @@ def print_table(rows, justify='left', hdr=True, vdelim=" ", padding=1): rows - list of rows ([[row 1], [row 2], ..., [row n]]) hdr - if True the first row is treated as a table header - vdelim - vertical delimiter betwee columns + vdelim - vertical delimiter between columns padding - # of spaces around the longest element in the column justify - may be left,center,right """ @@ -116,13 +116,14 @@ class Snapshots(Bcfg2.Server.Admin.Mode): if '-a' in args[1:]: q = self.session.query(Client.name, Snapshot.correct, + Snapshot.revision, Snapshot.timestamp).filter(Client.id==Snapshot.client_id)\ .group_by(Client.id) rows = [] - labels = ('Client', 'Correct', 'Time') + labels = ('Client', 'Correct', 'Revision', 'Time') for item in q.all(): - cli, cor, time = item - rows.append([cli, cor, time]) + cli, cor, time, rev = item + rows.append([cli, cor, time, rev]) print_table([labels]+rows, justify='left', hdr=True, vdelim=" ", padding=1) else: print "Unknown options: ", args[1:] |