[Spacewalk-list] patch: Add System ID output to spacecmd report inactivesystems
Dan MacDonald
allcoms at gmail.com
Mon Jul 11 09:49:41 UTC 2016
Hi list
My apologies if this has already been added to SW in git but I wrote this
small patch to spacecmd's report inactivesystems function so that it also
outputs the system ID of inactive systems making spacecmd useful for
scripting the removal of inactive systems.
Thanks
--- /usr/lib/python2.6/site-packages/spacecmd/report.py.bak 2016-05-17
13:48:12.410396146 +0100
+++ /usr/lib/python2.6/site-packages/spacecmd/report.py 2016-05-17
15:10:11.867394933 +0100
@@ -85,11 +85,12 @@
if len(systems):
max_size = max_length([s.get('name') for s in systems])
- print '%s %s' % ('System'.ljust(max_size), 'Last Checkin')
- print ('-' * max_size) + ' ------------'
+ print '%s %s %s' % ('System'.ljust(max_size), 'ID ', 'Last
Checkin')
+ print ('-' * max_size) + ' -- ----------'
for s in sorted(systems, key=itemgetter('name')):
- print '%s %s' % (s.get('name').ljust(max_size),
+ print '%s %s %s' % (s.get('name').ljust(max_size),
+ s.get('id'),
s.get('last_checkin'))
####################
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20160711/290c97ea/attachment.htm>
More information about the Spacewalk-list
mailing list