[Spacewalk-list] patch: Add System ID output to spacecmd report inactivesystems

Tomas Lestach tlestach at redhat.com
Mon Jul 11 12:13:38 UTC 2016


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 <allcoms at 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'))
> 
>  ####################
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20160711/28c9d3e4/attachment.htm>


More information about the Spacewalk-list mailing list