Hello Dan,

would you care to send a pull request?

 https://fedorahosted.org/spacewalk/wiki/Contribute

Regards,
--
Tomas Lestach
Red Hat Satellite Engineering


On Mon, Jul 11, 2016 at 11:49 AM, Dan MacDonald <allc...@gmail.com> wrote:
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'))

 ####################
_______________________________________________
Spacewalk-list mailing list
Spacewalk-list@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-list

Reply via email to