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()
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