ipalib.aci: Add support for == and != operators to ACI

This allows more natural comparisons.

Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Petr Viktorin 2014-04-30 17:24:06 +02:00
parent 64dcb1ec76
commit 6bdb30a15d

View File

@ -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