From: jiyin@redhat.com
To: bfields@redhat.com
Cc: linux-nfs@vger.kernel.org, "Jianhong.Yin" <yin-jianhong@163.com>
Subject: [PATCH 21/24] pynfs: python3 support plan: fix sort() fail and require python version
Date: Tue, 24 Jul 2018 15:33:39 +0800 [thread overview]
Message-ID: <20180724073342.5738-21-jiyin@redhat.com> (raw)
In-Reply-To: <20180724073342.5738-1-jiyin@redhat.com>
From: "Jianhong.Yin" <yin-jianhong@163.com>
Signed-off-by: Jianhong Yin <yin-jianhong@163.com>
---
nfs4.0/testserver.py | 6 +++---
nfs4.1/nfs4client.py | 2 +-
nfs4.1/nfs4lib.py | 2 +-
nfs4.1/testclient.py | 6 +++---
nfs4.1/testmod.py | 5 ++++-
nfs4.1/testserver.py | 6 +++---
6 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/nfs4.0/testserver.py b/nfs4.0/testserver.py
index ebce58d..e4a6db7 100755
--- a/nfs4.0/testserver.py
+++ b/nfs4.0/testserver.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# nfs4stest.py - nfsv4 server tester
#
-# Requires python 2.5
+# Requires python 2.7
#
# Written by Fred Isaman <iisaman@citi.umich.edu>
# Copyright (C) 2004 University of Michigan, Center for
@@ -26,8 +26,8 @@
import sys
-if sys.hexversion < 0x02050000:
- print("Requires python 2.5 or higher")
+if sys.hexversion < 0x02070000:
+ print("Requires python 2.7 or higher")
sys.exit(1)
import os
# Allow to be run stright from package root
diff --git a/nfs4.1/nfs4client.py b/nfs4.1/nfs4client.py
index e8c649b..be6b234 100644
--- a/nfs4.1/nfs4client.py
+++ b/nfs4.1/nfs4client.py
@@ -645,7 +645,7 @@ C.compound([C.bind_conn_to_session_op('0000000000000001', False, 3, False, 73, d
""" PROGRAM COVERAGE
-python2.5 ~/py_install/bin/coverage.py -x nfs4server.py
+python2.7 ~/py_install/bin/coverage.py -x nfs4server.py
coverage.py -a -d cover nfs4server.py
run test suite
"""
diff --git a/nfs4.1/nfs4lib.py b/nfs4.1/nfs4lib.py
index d46706a..5fed3ba 100644
--- a/nfs4.1/nfs4lib.py
+++ b/nfs4.1/nfs4lib.py
@@ -28,7 +28,7 @@ state00 = xdrdef.nfs4_type.stateid4(0, "\0" * 12)
state11 = xdrdef.nfs4_type.stateid4(0xffffffff, "\xff" * 12)
state01 = xdrdef.nfs4_type.stateid4(1, "\0" * 12)
-import hashlib # Note this requires 2.5 or higher
+import hashlib # Note this requires 2.7 or higher
op4 = nfs_ops.NFS4ops()
diff --git a/nfs4.1/testclient.py b/nfs4.1/testclient.py
index 5d21eaa..19bd148 100755
--- a/nfs4.1/testclient.py
+++ b/nfs4.1/testclient.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# nfs4stest.py - nfsv4 server tester
#
-# Requires python 2.5
+# Requires python 2.7
#
# Written by Fred Isaman <iisaman@citi.umich.edu>
# Copyright (C) 2004 University of Michigan, Center for
@@ -23,8 +23,8 @@
import use_local # HACK so don't have to rebuild constantly
import sys
-if sys.hexversion < 0x02050000:
- print("Requires python 2.5 or higher")
+if sys.hexversion < 0x02070000:
+ print("Requires python 2.7 or higher")
sys.exit(1)
import os
diff --git a/nfs4.1/testmod.py b/nfs4.1/testmod.py
index 6f576e2..68f7a5f 100644
--- a/nfs4.1/testmod.py
+++ b/nfs4.1/testmod.py
@@ -1,6 +1,6 @@
# testmod.py - run tests from a suite
#
-# Requires python 2.5
+# Requires python 2.7
#
# Written by Fred Isaman <iisaman@citi.umich.edu>
# Copyright (C) 2004 University of Michigan, Center for
@@ -157,6 +157,9 @@ class Test(object):
else:
return 1
+ def __lt__(self, other):
+ return self.__cmp__(other)
+
def __str__(self):
return "%-8s %s" % ( self.code, self.fullname)
diff --git a/nfs4.1/testserver.py b/nfs4.1/testserver.py
index 2becc13..249837e 100755
--- a/nfs4.1/testserver.py
+++ b/nfs4.1/testserver.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# nfs4stest.py - nfsv4 server tester
#
-# Requires python 2.5
+# Requires python 2.7
#
# Written by Fred Isaman <iisaman@citi.umich.edu>
# Copyright (C) 2004 University of Michigan, Center for
@@ -27,8 +27,8 @@
import use_local # HACK so don't have to rebuild constantly
import sys
-if sys.hexversion < 0x02050000:
- print("Requires python 2.5 or higher")
+if sys.hexversion < 0x02070000:
+ print("Requires python 2.7 or higher")
sys.exit(1)
import os
--
2.17.1
next prev parent reply other threads:[~2018-07-24 8:39 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-24 7:33 [PATCH 01/24] pynfs: python3 support plan: print -> print() jiyin
2018-07-24 7:33 ` [PATCH 02/24] pynfs: python3 support plan: exec -> exec() jiyin
2018-07-24 7:33 ` [PATCH 03/24] pynfs: python3 support plan: "except E,e:" -> "except E as e:" jiyin
2018-07-24 7:33 ` [PATCH 04/24] pynfs: python3 support plan: "raise E, args:" -> "raise E(args)" jiyin
2018-07-24 7:33 ` [PATCH 05/24] pynfs: python3 support plan: remove suffix 'L' of long integer jiyin
2018-07-24 7:33 ` [PATCH 06/24] pynfs: python3 support plan: octal literal 0644 -> 0o644 jiyin
2018-07-24 7:33 ` [PATCH 07/24] pynfs: python3 support plan: sys.maxint -> sys.maxsize jiyin
2018-07-24 7:33 ` [PATCH 08/24] pynfs: python3 support plan: cStringIO -> StringIO jiyin
2018-07-24 7:33 ` [PATCH 09/24] pynfs: python3 support plan: dict.has_key -> key in dict jiyin
2018-07-24 7:33 ` [PATCH 10/24] pynfs: python3 support plan: not equal op s/ <> / != / jiyin
2018-07-24 7:33 ` [PATCH 11/24] pynfs: python3 support plan: xdrgen: remove 'L' suffix of long integer jiyin
2018-07-24 7:33 ` [PATCH 12/24] pynfs: python3 support plan: file() -> open() jiyin
2018-07-24 7:33 ` [PATCH 13/24] pynfs: python3 support plan: list.sort() -> newlist = sorted(list) jiyin
2018-07-24 7:33 ` [PATCH 14/24] pynfs: python3 support plan: Relative Import -> Absolute Import jiyin
2018-07-24 7:33 ` [PATCH 15/24] pynfs: python3 support plan: fix 'socket' has no attribute '_socketobject' jiyin
2018-07-24 7:33 ` [PATCH 16/24] pynfs: python3 support plan: remove cPickle jiyin
2018-07-24 7:33 ` [PATCH 17/24] pynfs: python3 support plan: fix indent error on python3 jiyin
2018-07-24 7:33 ` [PATCH 18/24] pynfs: python3 support plan: fix 'TypeError: must be str, not bytes' jiyin
2018-07-24 7:33 ` [PATCH 19/24] pynfs: python3 support plan: fix import fail on python3 jiyin
2018-07-24 7:33 ` [PATCH 20/24] pynfs: python3 support plan: fix 'dict' has no attribute 'iteritems' jiyin
2018-07-24 7:33 ` jiyin [this message]
2018-07-24 7:33 ` [PATCH 22/24] pynfs: python3 support plan: fix ord() failure on python3 jiyin
2018-07-24 7:33 ` [PATCH 23/24] pynfs: python3 support plan: fix except multi exceptions in one line jiyin
2018-07-24 7:33 ` [PATCH 24/24] pynfs: python3 support plan: fix access class var in list comprehension jiyin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180724073342.5738-21-jiyin@redhat.com \
--to=jiyin@redhat.com \
--cc=bfields@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=yin-jianhong@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).