@@ -7,6 +7,7 @@
# Information Technology Integration
#
+from __future__ import absolute_import
import struct
import xdrlib
import socket
@@ -14,17 +15,17 @@ import select
import threading
import errno
-from rpc_const import *
-from rpc_type import *
-import rpc_pack
+from rpc.rpc_const import *
+from rpc.rpc_type import *
+import rpc.rpc_pack as rpc_pack
# Import security flavors and store valid ones
-from rpcsec.sec_auth_none import SecAuthNone
-from rpcsec.sec_auth_sys import SecAuthSys
+from .rpcsec.sec_auth_none import SecAuthNone
+from .rpcsec.sec_auth_sys import SecAuthSys
supported = {'none' : SecAuthNone,
'sys' : SecAuthSys }
try:
- from rpcsec.sec_auth_gss import SecAuthGss
+ from .rpcsec.sec_auth_gss import SecAuthGss
supported['gss'] = SecAuthGss
except ImportError:
pass
@@ -427,11 +428,11 @@ class RPCClient(object):
cred = self.security.make_cred()
p.pack_uint(xid)
p.pack_enum(CALL)
- p.pack_uint(RPCVERSION)
- p.pack_uint(prog)
- p.pack_uint(vers)
- p.pack_uint(proc)
- p.pack_opaque_auth(cred)
+ p.pack_uint(RPCVERSION)
+ p.pack_uint(prog)
+ p.pack_uint(vers)
+ p.pack_uint(proc)
+ p.pack_opaque_auth(cred)
verf = self.security.make_verf(p.get_buffer())
p.pack_opaque_auth(verf)
return p.get_buffer(), cred
@@ -1,4 +1,4 @@
-from base import SecFlavor, SecError
+from .base import SecFlavor, SecError
from rpc.rpc_const import RPCSEC_GSS
from rpc.rpc_type import opaque_auth
from gss_const import *
@@ -1,4 +1,4 @@
-from base import SecFlavor
+from .base import SecFlavor
class SecAuthNone(SecFlavor):
pass
@@ -1,4 +1,4 @@
-from base import SecFlavor, SecError
+from .base import SecFlavor, SecError
from rpc.rpc_const import AUTH_SYS
from rpc.rpc_type import opaque_auth
from xdrlib import Packer, Error
@@ -24,16 +24,8 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+from __future__ import absolute_import
-
-import rpc
-import threading
-from xdrlib import Error as XDRError
-import xdrdef.nfs4_const as nfs4_const
-from xdrdef.nfs4_const import *
-import xdrdef.nfs4_type as nfs4_type
-from xdrdef.nfs4_type import *
-import xdrdef.nfs4_pack as nfs4_pack
import time
import struct
import socket
@@ -41,6 +33,16 @@ import sys
import re
import inspect
from os.path import basename
+import threading
+
+import rpc.rpc as rpc
+import rpc.rpc_const as rpc_const
+import xdrdef.nfs4_const as nfs4_const
+from xdrdef.nfs4_const import *
+import xdrdef.nfs4_type as nfs4_type
+from xdrdef.nfs4_type import *
+from xdrlib import Error as XDRError
+import xdrdef.nfs4_pack as nfs4_pack
import nfs_ops
op4 = nfs_ops.NFS4ops()
@@ -1354,6 +1354,8 @@ allow_attr_passthrough = True # Option which allows substructure attrs to
# be referenced directly, in cases where there
# is a unique substructure to search.
pack_header = """\
+import sys,os
+sys.path.append(os.path.dirname(__file__))
import %s as const
import %s as types
import xdrlib
@@ -1438,7 +1440,7 @@ def run(infile, filters=True, pass_attrs=True, debug=False):
const_fd.write(comment_string)
type_fd = open(types_file + ".py", "w")
type_fd.write(comment_string)
- type_fd.write("import %s as const\n" % constants_file)
+ type_fd.write("import sys,os\nsys.path.append(os.path.dirname(__file__))\nimport %s as const\n" % constants_file)
pack_fd = open(packer_file + ".py", "w")
pack_fd.write(comment_string)
pack_fd.write(pack_header % (constants_file, types_file))