selftest: enable py3 for samba.tests.upgradeprovision
[metze/samba/wip.git] / python / samba / descriptor.py
index cf797cc3e94aa25877b9a2da30088f4726d8391f..a9c5e1580f0f0eefb96bdcb01ed1c9700c3e4636 100644 (file)
@@ -543,23 +543,23 @@ def get_diff_sds(refsd, cursd, domainsid, checkSacl = True):
     hash_cur = chunck_sddl(cursddl)
     hash_ref = chunck_sddl(refsddl)
 
-    if not hash_cur.has_key("owner"):
+    if "owner" not in hash_cur:
         txt = "\tNo owner in current SD"
-    elif hash_ref.has_key("owner") and hash_cur["owner"] != hash_ref["owner"]:
+    elif "owner" in hash_ref and hash_cur["owner"] != hash_ref["owner"]:
         txt = "\tOwner mismatch: %s (in ref) %s" \
               "(in current)\n" % (hash_ref["owner"], hash_cur["owner"])
 
-    if not hash_cur.has_key("group"):
+    if "group" not in hash_cur:
         txt = "%s\tNo group in current SD" % txt
-    elif hash_ref.has_key("group") and hash_cur["group"] != hash_ref["group"]:
+    elif "group" in hash_ref and hash_cur["group"] != hash_ref["group"]:
         txt = "%s\tGroup mismatch: %s (in ref) %s" \
               "(in current)\n" % (txt, hash_ref["group"], hash_cur["group"])
 
-    parts = [ "dacl" ]
+    parts = ["dacl"]
     if checkSacl:
         parts.append("sacl")
     for part in parts:
-        if hash_cur.has_key(part) and hash_ref.has_key(part):
+        if part in hash_cur and part in hash_ref:
 
             # both are present, check if they contain the same ACE
             h_cur = set()
@@ -590,9 +590,9 @@ def get_diff_sds(refsd, cursd, domainsid, checkSacl = True):
                     txt = "%s\t\t%s ACE is not present in the" \
                           " current\n" % (txt, item)
 
-        elif hash_cur.has_key(part) and not hash_ref.has_key(part):
+        elif part in hash_cur and part not in hash_ref:
             txt = "%s\tReference ACL hasn't a %s part\n" % (txt, part)
-        elif not hash_cur.has_key(part) and hash_ref.has_key(part):
+        elif part not in hash_cur and part in hash_ref:
             txt = "%s\tCurrent ACL hasn't a %s part\n" % (txt, part)
 
     return txt