From patchwork Wed Jun 4 21:01:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weston Andros Adamson X-Patchwork-Id: 4297021 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 44DDD9F1D6 for ; Wed, 4 Jun 2014 21:03:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 843042012E for ; Wed, 4 Jun 2014 21:03:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AB80C20142 for ; Wed, 4 Jun 2014 21:03:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751979AbaFDVDP (ORCPT ); Wed, 4 Jun 2014 17:03:15 -0400 Received: from mail-ig0-f178.google.com ([209.85.213.178]:61871 "EHLO mail-ig0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751965AbaFDVCQ (ORCPT ); Wed, 4 Jun 2014 17:02:16 -0400 Received: by mail-ig0-f178.google.com with SMTP id h18so1554304igc.5 for ; Wed, 04 Jun 2014 14:02:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wElV9+fj6gpOD28S+8xk6n9fJ4bv6rLmsw7YBMMfLdo=; b=hcqbB4ASI13149zT+8J4ltJtM6ZyKUcpUqypDEd5A+QE6larc5UiUai3LNrZ+8PwXh LbYcHv5RiHf7vh8ry72usBEeacOboIef0H7zJqxLJ7Ng45FmdaQIjAbk1A8d2nau5ckc +aM3VtqnHY7qlyK9+kq+XO5gP91CwAcfhN8w/Dhv4HoouvCXEAfkRUKbfM3/A+k5SK/p 6L4G3Hunu17Uzf14bOr/ffpIWvkucNQd8WL4nDxI4VChxnehBZdSFeViUOJIQj3d+96S y9Bl3nMzCXA4Rp8/uy7YOhXQRdin/NqdnSHUSdMmX0nYTQIyH2mD/EUNbqxHNVCI++iK kfrA== X-Gm-Message-State: ALoCoQmmJbXDMUgUbwSSyngP/wnAc90Mziqjg84oDWPy9wiDexZUazfrnOnRM3tfYO5jxSCiSHZl X-Received: by 10.50.32.70 with SMTP id g6mr11578629igi.0.1401915735650; Wed, 04 Jun 2014 14:02:15 -0700 (PDT) Received: from gavrio-wifi.robotsandstuff.fake (c-98-209-19-144.hsd1.mi.comcast.net. [98.209.19.144]) by mx.google.com with ESMTPSA id qh3sm47684584igb.17.2014.06.04.14.02.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 04 Jun 2014 14:02:14 -0700 (PDT) From: Weston Andros Adamson To: bfields@fieldses.org Cc: linux-nfs@vger.kernel.org, Weston Andros Adamson Subject: [PATCH pynfs 03/17] dataserver: only catch connection error Date: Wed, 4 Jun 2014 17:01:51 -0400 Message-Id: <1401915726-29092-4-git-send-email-dros@primarydata.com> X-Mailer: git-send-email 1.8.5.2 (Apple Git-48) In-Reply-To: <1401915726-29092-1-git-send-email-dros@primarydata.com> References: <1401915726-29092-1-git-send-email-dros@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 This specifically checks for the error being reported, otherwise a other exceptions like a programming error will be caught and treated as connection errors. Signed-off-by: Weston Andros Adamson --- nfs4.1/dataserver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nfs4.1/dataserver.py b/nfs4.1/dataserver.py index 65e4f55..b8dd903 100644 --- a/nfs4.1/dataserver.py +++ b/nfs4.1/dataserver.py @@ -9,6 +9,7 @@ import nfs4client import hashlib import sys import nfs4_ops as op +import socket log = logging.getLogger("Dataserver Manager") @@ -197,7 +198,7 @@ class DSDevice(object): ds = DataServer(server, port, path, mdsds=self.mdsds, multipath_servers=server_list) self.list.append(ds) - except: + except socket.error: log.critical("cannot access %s:%i/%s" % (server, port, '/'.join(path))) sys.exit(1)