summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/scripting/python/samba/__init__.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py
index 5379530054..59a6e00c5d 100644
--- a/source4/scripting/python/samba/__init__.py
+++ b/source4/scripting/python/samba/__init__.py
@@ -98,11 +98,13 @@ class Ldb(ldb.Ldb):
glue.ldb_set_utf8_casefold(self)
# Allow admins to force non-sync ldb for all databases
- nosync_p = lp.get("nosync", "ldb")
- if nosync_p is not None and nosync_p == true:
+ if lp is not None:
+ nosync_p = lp.get("nosync", "ldb")
+ if nosync_p is not None and nosync_p == true:
flags |= FLG_NOSYNC
- self.connect(url, flags, options)
+ if url is not None:
+ self.connect(url, flags, options)
def set_credentials(self, credentials):
glue.ldb_set_credentials(self, credentials)