From 48705b803480b14d9fd3d6903b111e6d46aa65d0 Mon Sep 17 00:00:00 2001 From: Sol Jerome Date: Wed, 15 Apr 2009 00:18:04 +0000 Subject: Add revision to bcfg2-admin snapshots reports Signed-off-by: Sol Jerome git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5164 ce84e21b-d406-0410-9b95-82705330c041 --- src/lib/Server/Admin/Snapshots.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/lib/Server/Admin/Snapshots.py') 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:] -- cgit v1.2.3-1-g7c22