summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2014-04-30 17:24:06 +0200
committerPetr Viktorin <pviktori@redhat.com>2014-04-30 22:16:27 +0200
commit6bdb30a15d011185f6716608909fd5561dabf8de (patch)
tree752819f82d14048977e19f9d22077407d3025216
parent64dcb1ec76fa706320746720431ef815eb3e9ecd (diff)
downloadfreeipa-6bdb30a15d011185f6716608909fd5561dabf8de.tar.gz
freeipa-6bdb30a15d011185f6716608909fd5561dabf8de.tar.xz
freeipa-6bdb30a15d011185f6716608909fd5561dabf8de.zip
ipalib.aci: Add support for == and != operators to ACI
This allows more natural comparisons. Reviewed-By: Rob Crittenden <rcritten@redhat.com>
-rwxr-xr-xipalib/aci.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ipalib/aci.py b/ipalib/aci.py
index c911da188..93b1c2d1c 100755
--- a/ipalib/aci.py
+++ b/ipalib/aci.py
@@ -253,6 +253,12 @@ class ACI:
# We got this far so lets declare them the same
return True
+ __eq__ = isequal
+
+ def __neq__(self, b):
+ return not self == b
+
+
if __name__ == '__main__':
# a = ACI('(targetattr="title")(targetfilter="(memberOf=cn=bar,cn=groups,cn=accounts ,dc=example,dc=com)")(version 3.0;acl "foobar";allow (write) groupdn="ldap:///cn=foo,cn=groups,cn=accounts,dc=example,dc=com";)')
# print a