[PATCH] samba-tool processes: Make the output a bit nicer
esiotrot at gmail.com
Thu Dec 6 08:17:15 MST 2012
On 6 December 2012 14:54, Ricky Nance <ricky.nance at weaubleau.k12.mo.us>wrote:
> Michael thanks for the comments, I didn't realize that about .format (what
> I had read said for versions lower than 3). I thought I had vi setup to
> report the extra spaces, I will have to look into why thats not working as
> expected now. Anyway with your revisions here is the new patch.
Looks good to me.
> On Thu, Dec 6, 2012 at 3:13 AM, Michael Wood <esiotrot at gmail.com> wrote:
>> Hi Ricky
>> On 6 December 2012 08:12, Ricky Nance <ricky.nance at weaubleau.k12.mo.us>
>> > This patch makes samba-tool processes output like:
>> > Service: PID
>> > ---------------------------------------
>> > dnsupdate 25964
>> > nbt_server 25954
>> > cldap_server 25958
>> > winbind_server 25961
>> > kdc_server 25959
>> > samba 0
>> > dreplsrv 25960
>> > kccsrv 25963
>> > (it looks nicer in a terminal)
>> > I also removed the newline if you use the --name or --pid option as
>> > already gives a newline, so IF someone were to write a script that uses
>> > this it won't have the extra newline now.
>> This looks good, but I have a couple of comments:
>> "...".format() doesn't appear to work on Python 2.5 and below. There
>> are still people that occasionally pop up on the list trying to use
>> Python 2.4, so it seems it would be a better idea to use something
>> like this:
>> print "%-16s %6d" % (name.name, server_id.pid)
>> Otherwise, some possible nit picks :)
>> All the other strings in the patch use double quotes, but the one with
>> the .format() uses single quotes.
>> Also, I think it might be a good idea to avoid the tabs in the output
>> and just use spaces.
>> The print statement with the .format() is indented 5 spaces more than
>> the previous line instead of the usual 4.
Michael Wood <esiotrot at gmail.com>
More information about the samba-technical