Skip to content

Commit 46a8c7a

Browse files
MrMEEEMarkSymsCtx
authored andcommitted
NFS 4.1 Support
Signed-off-by: Martin Juhl <m@rtinjuhl.dk>
1 parent 41b6a0e commit 46a8c7a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

drivers/nfs.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
DEFAULT_NFSVERSION = '3'
4949

5050
NFS_VERSION = [
51-
'nfsversion', 'for type=nfs, NFS protocol version - 3, 4']
51+
'nfsversion', 'for type=nfs, NFS protocol version - 3, 4, 4.1']
5252

5353
NFS_SERVICE_WAIT = 30
5454
NFS_SERVICE_RETRY = 6
@@ -111,7 +111,7 @@ def validate_nfsversion(nfsversion):
111111
if not nfsversion:
112112
nfsversion = DEFAULT_NFSVERSION
113113
else:
114-
if nfsversion not in ['3', '4']:
114+
if nfsversion not in ['3', '4', '4.1']:
115115
raise NfsException("Invalid nfsversion.")
116116
return nfsversion
117117

@@ -143,6 +143,9 @@ def soft_mount(mountpoint, remoteserver, remotepath, transport, useroptions='',
143143
mountcommand = 'mount.nfs'
144144
if nfsversion == '4':
145145
mountcommand = 'mount.nfs4'
146+
147+
if nfsversion == '4.1':
148+
mountcommand = 'mount.nfs4'
146149

147150
options = "soft,proto=%s,vers=%s" % (
148151
transport,

tests/test_nfs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def test_validate_nfsversion_invalid(self):
119119
thenfsversion)
120120

121121
def test_validate_nfsversion_unsupported(self):
122-
for thenfsversion in ['2', '4.1']:
122+
for thenfsversion in ['2']:
123123
self.assertRaises(nfs.NfsException, nfs.validate_nfsversion,
124124
thenfsversion)
125125

@@ -128,6 +128,6 @@ def test_validate_nfsversion_default(self):
128128
self.assertEquals(nfs.validate_nfsversion(thenfsversion), '3')
129129

130130
def test_validate_nfsversion_valid(self):
131-
for thenfsversion in ['3', '4']:
131+
for thenfsversion in ['3', '4', '4.1']:
132132
self.assertEquals(nfs.validate_nfsversion(thenfsversion),
133133
thenfsversion)

0 commit comments

Comments
 (0)