s4-pydsdb: don't force am_rodc unless it is set by caller
authorAndrew Tridgell <tridge@samba.org>
Sun, 19 Sep 2010 02:28:05 +0000 (19:28 -0700)
committerAndrew Tridgell <tridge@samba.org>
Sun, 19 Sep 2010 18:29:32 +0000 (11:29 -0700)
we should normally get the rodc flag by looking at the database, not
by forcing it in the database connect

source4/scripting/python/samba/samdb.py

index e2ac37a24024c95a5ee70da5a417c454c13dccb7..c43c65da933ac2ac3b2c73c012986503f801a4ca 100644 (file)
@@ -40,7 +40,7 @@ class SamDB(samba.Ldb):
 
     def __init__(self, url=None, lp=None, modules_dir=None, session_info=None,
                  credentials=None, flags=0, options=None, global_schema=True,
-                 auto_connect=True, am_rodc=False):
+                 auto_connect=True, am_rodc=None):
         self.lp = lp
         if not auto_connect:
             url = None
@@ -54,7 +54,8 @@ class SamDB(samba.Ldb):
         if global_schema:
             dsdb._dsdb_set_global_schema(self)
 
-        dsdb._dsdb_set_am_rodc(self, am_rodc)
+        if am_rodc is not None:
+            dsdb._dsdb_set_am_rodc(self, am_rodc)
 
     def connect(self, url=None, flags=0, options=None):
         if self.lp is not None: