* [PATCH] Fix Python 3 compatibility of mountstats and nfs-iostat
@ 2014-07-17 9:57 Slavek Kabrda
2014-07-25 15:01 ` Steve Dickson
0 siblings, 1 reply; 2+ messages in thread
From: Slavek Kabrda @ 2014-07-17 9:57 UTC (permalink / raw)
To: linux-nfs; +Cc: Slavek Kabrda
Signed-off-by: Slavek Kabrda <bkabrda@redhat.com>
---
tools/mountstats/mountstats.py | 2 +-
tools/nfs-iostat/nfs-iostat.py | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py
index e46105d..1fb3e2f 100644
--- a/tools/mountstats/mountstats.py
+++ b/tools/mountstats/mountstats.py
@@ -371,7 +371,7 @@ def parse_stats_file(filename):
ms_dict = dict()
key = ''
- f = file(filename)
+ f = open(filename)
for line in f.readlines():
words = line.split()
if len(words) == 0:
diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
index b324cd8..61d15a5 100644
--- a/tools/nfs-iostat/nfs-iostat.py
+++ b/tools/nfs-iostat/nfs-iostat.py
@@ -213,7 +213,8 @@ class DeviceData:
# the reference to them. so we build new lists here
# for the result object.
for op in result.__rpc_data['ops']:
- result.__rpc_data[op] = map(difference, self.__rpc_data[op], old_stats.__rpc_data[op])
+ result.__rpc_data[op] = list(map(
+ difference, self.__rpc_data[op], old_stats.__rpc_data[op]))
# update the remaining keys we care about
result.__rpc_data['rpcsends'] -= old_stats.__rpc_data['rpcsends']
--
2.0.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix Python 3 compatibility of mountstats and nfs-iostat
2014-07-17 9:57 [PATCH] Fix Python 3 compatibility of mountstats and nfs-iostat Slavek Kabrda
@ 2014-07-25 15:01 ` Steve Dickson
0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2014-07-25 15:01 UTC (permalink / raw)
To: Slavek Kabrda, linux-nfs
On 17/07/14 05:57, Slavek Kabrda wrote:
> Signed-off-by: Slavek Kabrda <bkabrda@redhat.com>
Committed...
steved.
> ---
> tools/mountstats/mountstats.py | 2 +-
> tools/nfs-iostat/nfs-iostat.py | 3 ++-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tools/mountstats/mountstats.py b/tools/mountstats/mountstats.py
> index e46105d..1fb3e2f 100644
> --- a/tools/mountstats/mountstats.py
> +++ b/tools/mountstats/mountstats.py
> @@ -371,7 +371,7 @@ def parse_stats_file(filename):
> ms_dict = dict()
> key = ''
>
> - f = file(filename)
> + f = open(filename)
> for line in f.readlines():
> words = line.split()
> if len(words) == 0:
> diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
> index b324cd8..61d15a5 100644
> --- a/tools/nfs-iostat/nfs-iostat.py
> +++ b/tools/nfs-iostat/nfs-iostat.py
> @@ -213,7 +213,8 @@ class DeviceData:
> # the reference to them. so we build new lists here
> # for the result object.
> for op in result.__rpc_data['ops']:
> - result.__rpc_data[op] = map(difference, self.__rpc_data[op], old_stats.__rpc_data[op])
> + result.__rpc_data[op] = list(map(
> + difference, self.__rpc_data[op], old_stats.__rpc_data[op]))
>
> # update the remaining keys we care about
> result.__rpc_data['rpcsends'] -= old_stats.__rpc_data['rpcsends']
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-07-25 15:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-17 9:57 [PATCH] Fix Python 3 compatibility of mountstats and nfs-iostat Slavek Kabrda
2014-07-25 15:01 ` Steve Dickson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).