s4-rodc: cope with missing searchFlags
authorAndrew Tridgell <tridge@samba.org>
Thu, 9 Sep 2010 11:38:01 +0000 (21:38 +1000)
committerAndrew Tridgell <tridge@samba.org>
Thu, 9 Sep 2010 11:39:25 +0000 (21:39 +1000)
this can be missing after the schema tests

source4/scripting/python/samba/drs_utils.py

index 7b22a8413e290d28532b279843f743371a2c630c..854608a1fd00b102d76c4585226a620e52b1903a 100644 (file)
@@ -94,9 +94,10 @@ class drs_Replicate():
                 if (int(system_flags) & (samba.dsdb.DS_FLAG_ATTR_NOT_REPLICATED |
                                          samba.dsdb.DS_FLAG_ATTR_IS_CONSTRUCTED)):
                     continue
-            search_flags = r["searchFlags"][0]
-            if (int(search_flags) & samba.dsdb.SEARCH_FLAG_RODC_ATTRIBUTE):
-                continue
+            if "searchFlags" in r:
+                search_flags = r["searchFlags"][0]
+                if (int(search_flags) & samba.dsdb.SEARCH_FLAG_RODC_ATTRIBUTE):
+                    continue
             attid = self.samdb.get_attid_from_lDAPDisplayName(ldap_display_name)
             attids.append(int(attid))