Linux-NFS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] nfs41client: fix raising an error when pnfs test hits non pnfs server
@ 2020-07-21 19:43 Tigran Mkrtchyan
  2020-07-22 13:58 ` J. Bruce Fields
  0 siblings, 1 reply; 2+ messages in thread
From: Tigran Mkrtchyan @ 2020-07-21 19:43 UTC (permalink / raw)
  To: bfields; +Cc: linux-nfs, Tigran Mkrtchyan

fail function is not defined

Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
---
 nfs4.1/nfs4client.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/nfs4.1/nfs4client.py b/nfs4.1/nfs4client.py
index f06d9c5..3d55f96 100644
--- a/nfs4.1/nfs4client.py
+++ b/nfs4.1/nfs4client.py
@@ -1,7 +1,7 @@
 import use_local # HACK so don't have to rebuild constantly
 import rpc.rpc as rpc
 import nfs4lib
-from nfs4lib import NFS4Error, NFS4Replay, inc_u32
+from nfs4lib import NFS4Error, NFS4Replay, inc_u32, UnexpectedCompoundRes
 from xdrdef.nfs4_type import *
 from xdrdef.nfs4_const import *
 from xdrdef.sctrl_pack import SCTRLPacker, SCTRLUnpacker
@@ -331,7 +331,7 @@ class NFS4Client(rpc.Client, rpc.Server):
         # Make sure E_ID returns MDS capabilities
         c = self.new_client(name, flags=flags)
         if not c.flags & EXCHGID4_FLAG_USE_PNFS_MDS:
-            fail("Server can not be used as pnfs metadata server")
+            raise UnexpectedCompoundRes("Server can not be used as pnfs metadata server")
         s = c.create_session(sec=sec)
         s.compound([op4.reclaim_complete(FALSE)])
         return s
-- 
2.26.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] nfs41client: fix raising an error when pnfs test hits non pnfs server
  2020-07-21 19:43 [PATCH] nfs41client: fix raising an error when pnfs test hits non pnfs server Tigran Mkrtchyan
@ 2020-07-22 13:58 ` J. Bruce Fields
  0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2020-07-22 13:58 UTC (permalink / raw)
  To: Tigran Mkrtchyan; +Cc: linux-nfs

On Tue, Jul 21, 2020 at 09:43:58PM +0200, Tigran Mkrtchyan wrote:
> fail function is not defined

It's used elsewhere, e.g. st_sequence.py, I think we just need an
import.

> 
> Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
> ---
>  nfs4.1/nfs4client.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/nfs4.1/nfs4client.py b/nfs4.1/nfs4client.py
> index f06d9c5..3d55f96 100644
> --- a/nfs4.1/nfs4client.py
> +++ b/nfs4.1/nfs4client.py
> @@ -1,7 +1,7 @@
>  import use_local # HACK so don't have to rebuild constantly
>  import rpc.rpc as rpc
>  import nfs4lib
> -from nfs4lib import NFS4Error, NFS4Replay, inc_u32
> +from nfs4lib import NFS4Error, NFS4Replay, inc_u32, UnexpectedCompoundRes
>  from xdrdef.nfs4_type import *
>  from xdrdef.nfs4_const import *
>  from xdrdef.sctrl_pack import SCTRLPacker, SCTRLUnpacker
> @@ -331,7 +331,7 @@ class NFS4Client(rpc.Client, rpc.Server):
>          # Make sure E_ID returns MDS capabilities
>          c = self.new_client(name, flags=flags)
>          if not c.flags & EXCHGID4_FLAG_USE_PNFS_MDS:
> -            fail("Server can not be used as pnfs metadata server")
> +            raise UnexpectedCompoundRes("Server can not be used as pnfs metadata server")
>          s = c.create_session(sec=sec)
>          s.compound([op4.reclaim_complete(FALSE)])
>          return s
> -- 
> 2.26.2

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 19:43 [PATCH] nfs41client: fix raising an error when pnfs test hits non pnfs server Tigran Mkrtchyan
2020-07-22 13:58 ` J. Bruce Fields

Linux-NFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nfs/0 linux-nfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nfs linux-nfs/ https://lore.kernel.org/linux-nfs \
		linux-nfs@vger.kernel.org
	public-inbox-index linux-nfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-nfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git