From patchwork Thu Jul 17 09:57:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bohuslav Kabrda X-Patchwork-Id: 4574221 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8E118C0514 for ; Thu, 17 Jul 2014 09:58:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C270E20120 for ; Thu, 17 Jul 2014 09:58:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C0C822011E for ; Thu, 17 Jul 2014 09:58:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755969AbaGQJ61 (ORCPT ); Thu, 17 Jul 2014 05:58:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20336 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755648AbaGQJ60 (ORCPT ); Thu, 17 Jul 2014 05:58:26 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6H9wQVO016941 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 17 Jul 2014 05:58:26 -0400 Received: from dhcp-30-110.brq.redhat.com (dhcp-30-131.brq.redhat.com [10.34.30.131]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6H9wPcp025366; Thu, 17 Jul 2014 05:58:25 -0400 From: Slavek Kabrda To: linux-nfs@vger.kernel.org Cc: Slavek Kabrda Subject: [PATCH] Fix Python 3 compatibility of mountstats and nfs-iostat Date: Thu, 17 Jul 2014 11:57:32 +0200 Message-Id: <1405591052-17456-1-git-send-email-bkabrda@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Slavek Kabrda --- 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']