summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsource4/scripting/bin/minschema.py4
-rwxr-xr-xsource4/scripting/bin/rpcclient4
-rwxr-xr-xsource4/scripting/bin/samba3dump5
-rwxr-xr-xsource4/scripting/bin/subunitrun4
-rwxr-xr-xsource4/scripting/bin/winreg.py4
-rwxr-xr-xsource4/setup/newuser6
-rwxr-xr-xsource4/setup/provision3
-rwxr-xr-xsource4/setup/upgrade.py4
8 files changed, 30 insertions, 4 deletions
diff --git a/source4/scripting/bin/minschema.py b/source4/scripting/bin/minschema.py
index fb9d7b05aa..6dd5b42aff 100755
--- a/source4/scripting/bin/minschema.py
+++ b/source4/scripting/bin/minschema.py
@@ -4,6 +4,10 @@
#
import optparse
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
import samba
from samba import getopt as options
import sys
diff --git a/source4/scripting/bin/rpcclient b/source4/scripting/bin/rpcclient
index 34efafdf73..aba4f9ddb3 100755
--- a/source4/scripting/bin/rpcclient
+++ b/source4/scripting/bin/rpcclient
@@ -1,6 +1,10 @@
#!/usr/bin/python
import sys, os, string
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
from cmd import Cmd
from optparse import OptionParser
from pprint import pprint
diff --git a/source4/scripting/bin/samba3dump b/source4/scripting/bin/samba3dump
index 8f56d423d8..d89667233f 100755
--- a/source4/scripting/bin/samba3dump
+++ b/source4/scripting/bin/samba3dump
@@ -7,7 +7,10 @@
import optparse
import os, sys
-sys.path.append(os.path.join(os.path.dirname(__file__), "../python"))
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
import samba
import samba.samba3
diff --git a/source4/scripting/bin/subunitrun b/source4/scripting/bin/subunitrun
index 719a58d9e5..de11aba3cc 100755
--- a/source4/scripting/bin/subunitrun
+++ b/source4/scripting/bin/subunitrun
@@ -18,7 +18,9 @@
#
import sys
-sys.path.append("bin/python")
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
from subunit import SubunitTestRunner
from unittest import TestProgram
diff --git a/source4/scripting/bin/winreg.py b/source4/scripting/bin/winreg.py
index 1e39ee8f78..19d39e56ab 100755
--- a/source4/scripting/bin/winreg.py
+++ b/source4/scripting/bin/winreg.py
@@ -7,6 +7,10 @@
#
import sys
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
import winreg
import optparse
import samba.getopt as options
diff --git a/source4/setup/newuser b/source4/setup/newuser
index 04a5440ee1..26bac76f02 100755
--- a/source4/setup/newuser
+++ b/source4/setup/newuser
@@ -6,10 +6,14 @@
# Released under the GNU GPL version 3 or later
#
+import sys
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
import samba.getopt as options
import optparse
import pwd
-import sys
from getpass import getpass
from auth import system_session
from samba.samdb import SamDB
diff --git a/source4/setup/provision b/source4/setup/provision
index ad289aaaa3..2579bc4f19 100755
--- a/source4/setup/provision
+++ b/source4/setup/provision
@@ -26,7 +26,8 @@ import getopt
import optparse
import os, sys
-sys.path.append("bin/python")
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
import samba
import param
diff --git a/source4/setup/upgrade.py b/source4/setup/upgrade.py
index 3bcc57ab64..b1d9ffa37c 100755
--- a/source4/setup/upgrade.py
+++ b/source4/setup/upgrade.py
@@ -7,6 +7,10 @@
import getopt
import optparse
import os, sys
+
+# Find right directory when running from source tree
+sys.path.insert(0, "bin/python")
+
import param
import samba
import samba.getopt as options