diff options
author | Petr Viktorin <pviktori@redhat.com> | 2014-04-30 17:24:06 +0200 |
---|---|---|
committer | Petr Viktorin <pviktori@redhat.com> | 2014-04-30 22:16:27 +0200 |
commit | 6bdb30a15d011185f6716608909fd5561dabf8de (patch) | |
tree | 752819f82d14048977e19f9d22077407d3025216 /ipalib/aci.py | |
parent | 64dcb1ec76fa706320746720431ef815eb3e9ecd (diff) | |
download | freeipa-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>
Diffstat (limited to 'ipalib/aci.py')
-rwxr-xr-x | ipalib/aci.py | 6 |
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 |