Bug#807017: nfsiostat: superfluous linebreaks in output
Package: nfs-common
Version: 1:1.2.8-9
Severity: minor
Tags: patch
With nfsiostat 1 (on different machine, but with same nfs-common version, I also
verified the issue happens on my laptop as well, but unmounted NFS again) I get:
akademie2://kurs mounted on /mnt/kurs:
op/s rpc bklog
0.00
0.00
read:
ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms)
0.000
0.000
0.000
0 (0.0%)
0.000
0.000
write:
ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms)
0.000
0.000
0.000
0 (0.0%)
0.000
0.000
And I bet it is supposed to look more like this:
akademie2://kurs mounted on /mnt/kurs:
op/s rpc bklog
0.00 0.00
read:
ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms)
0.000 0.000 0.000 0 (0.0%) 0.000 0.000
write:
ops/s kB/s kB/op retrans avg RTT (ms) avg exe (ms)
0.000 0.000 0.000 0 (0.0%) 0.000 0.000
I attach a patch with a bugfix inspired by:
http://stackoverflow.com/questions/493386/how-to-print-in-python-without-newline-or-space
the print ("something), variant did not work, so I used sys.stdout.write.
Bugreporting script returned with error on my machine, but it is not necessary
for this bug report.
merkaba:~#1> /usr/share/bug/nfs-common/script
/usr/share/bug/nfs-common/script: 4: /usr/share/bug/nfs-common/script: 3: Bad file descriptor
I may report upstream at a later time.
Thanks,
Martin
-- Package-specific info:
-- rpcinfo --
program vers proto port service
100000 4 tcp 111 portmapper
100000 3 tcp 111 portmapper
100000 2 tcp 111 portmapper
100000 4 udp 111 portmapper
100000 3 udp 111 portmapper
100000 2 udp 111 portmapper
-- /etc/default/nfs-common --
NEED_STATD=
STATDOPTS=
NEED_IDMAPD=
NEED_GSSD=
-- /etc/idmapd.conf --
[General]
Verbosity = 0
Pipefs-Directory = /run/rpc_pipefs
[Mapping]
Nobody-User = nobody
Nobody-Group = nogroup
-- /etc/fstab --
not relevant.
-- /proc/mounts --
-- System Information:
Debian Release: stretch/sid
APT prefers unstable
APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.3.0-tp520-btrfstrim+ (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
Versions of packages nfs-common depends on:
ii adduser 3.113+nmu3
ii initscripts 2.88dsf-59.2
ii libc6 2.21-1
ii libcap2 1:2.24-12
ii libcomerr2 1.42.13-1
ii libdevmapper1.02.1 2:1.02.110-1
ii libevent-2.0-5 2.0.21-stable-2+b1
ii libgssapi-krb5-2 1.13.2+dfsg-4
ii libk5crypto3 1.13.2+dfsg-4
ii libkeyutils1 1.5.9-8
ii libkrb5-3 1.13.2+dfsg-4
ii libmount1 2.27.1-1
ii libnfsidmap2 0.25-5
ii libtirpc1 0.2.5-1
ii libwrap0 7.6.q-25
ii lsb-base 9.20150917
ii rpcbind 0.2.3-0.2
ii ucf 3.0031
Versions of packages nfs-common recommends:
ii python 2.7.9-1
Versions of packages nfs-common suggests:
pn open-iscsi <none>
pn watchdog <none>
-- no debconf information
--- /usr/sbin/nfsiostat.orig 2014-08-13 02:55:59.000000000 +0200
+++ /usr/sbin/nfsiostat 2015-12-04 10:27:00.270935431 +0100
@@ -358,8 +358,8 @@ class DeviceData:
- print('\t\t%7.3f' % (ops / sample_time))
- print('\t%7.3f' % (kilobytes / sample_time))
- print('\t%7.3f' % kb_per_op)
- print(' %7d (%3.1f%%)' % (retrans, retrans_percent))
- print('\t%7.3f' % rtt_per_op)
- print('\t%7.3f' % exe_per_op)
+ sys.stdout.write('%7.3f' % (ops / sample_time))
+ sys.stdout.write('\t\t%7.3f' % (kilobytes / sample_time))
+ sys.stdout.write('\t\t%7.3f' % kb_per_op)
+ sys.stdout.write('\t %7d (%3.1f%%)' % (retrans, retrans_percent))
+ sys.stdout.write('\t\t%7.3f' % rtt_per_op)
+ print('\t\t%7.3f' % exe_per_op)
@@ -394,4 +394,4 @@ class DeviceData:
print(' op/s\t\trpc bklog')
- print('%7.2f' % (sends / sample_time))
- print('\t%7.2f' % backlog)
+ sys.stdout.write('%7.2f' % (sends / sample_time))
+ print('\t\t%7.2f' % backlog)
Reply to: