Skip to contentSkip to conversation

Use constants generated from the .x file for NFS_PROGRAM and versions.

PATCH New [email protected] 1 participant 1 message Apr 10, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use constants generated from the .x file for NFS_PROGRAM and versions.

From: Bryan Schmersal <[email protected]>

---
 nfs4.1/nfs3client.py | 4 ++--
 nfs4.1/nfs4client.py | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
nfs4.1/nfs3client.py +2 -2
index f98f691..9dee653 100644
@@ -119,11 +119,11 @@ class Mnt3Client(rpc.Client):
 
 class NFS3Client(rpc.Client):
     def __init__(self, host='localhost', port=None, ctrl_proc=16, summary=None):
-        rpc.Client.__init__(self, 100003, 3)
+        rpc.Client.__init__(self, NFS_PROGRAM, NFS_V3)
         self.portmap = PORTMAPClient(host=host)
         self.mntport = self.portmap.get_port(MOUNT_PROGRAM, MOUNT_V3)
         if not port:
-            self.port = self.portmap.get_port(100003, 3)
+            self.port = self.portmap.get_port(NFS_PROGRAM, NFS_V3)
         else:
             self.port = port
 
nfs4.1/nfs4client.py +3 -3
index ae90cc2..031f89f 100644
@@ -28,9 +28,9 @@ SHOW_TRAFFIC = 0
 
 class NFS4Client(rpc.Client, rpc.Server):
     def __init__(self, host=b'localhost', port=2049, minorversion=2, ctrl_proc=16, summary=None, secure=False):
-        rpc.Client.__init__(self, 100003, 4)
-        self.prog = 0x40000000
-        self.versions = [1] # List of supported versions of prog
+        rpc.Client.__init__(self, NFS4_PROGRAM, NFS_V4)
+        self.prog = NFS4_CALLBACK
+        self.versions = [NFS_CB] # List of supported versions of prog
 
         self.minorversion = minorversion
         self.minor_versions = [minorversion]
Signature · 1 line
2.34.1