summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/aci.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2013-11-29 12:57:30 +0100
committerMartin Kosek <mkosek@redhat.com>2013-12-13 15:08:52 +0100
commitf47669a5b969a512756a39f451f04ed9c95ce3ab (patch)
treeecdaf467d67ecfd1c3dbd1d7c423e8243235db95 /ipalib/plugins/aci.py
parentd7ee87cfa1e288fe18dc2dbeb2d691753048f4db (diff)
downloadfreeipa-f47669a5b969a512756a39f451f04ed9c95ce3ab.tar.gz
freeipa-f47669a5b969a512756a39f451f04ed9c95ce3ab.tar.xz
freeipa-f47669a5b969a512756a39f451f04ed9c95ce3ab.zip
Verify ACIs are added correctly in tests
To double-check the ACIs are correct, this uses different code than the new permission plugin: the aci_show command. A new option, location, is added to the command to support these checks.
Diffstat (limited to 'ipalib/plugins/aci.py')
-rw-r--r--ipalib/plugins/aci.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/ipalib/plugins/aci.py b/ipalib/plugins/aci.py
index 328effcbc..a4c386654 100644
--- a/ipalib/plugins/aci.py
+++ b/ipalib/plugins/aci.py
@@ -120,8 +120,8 @@ targetattr REPLACES the current attributes, it does not add to them.
from copy import deepcopy
from ipalib import api, crud, errors
-from ipalib import Object, Command
-from ipalib import Flag, Int, Str, StrEnum
+from ipalib import Object
+from ipalib import Flag, Str, StrEnum, DNParam
from ipalib.aci import ACI
from ipalib import output
from ipalib import _, ngettext
@@ -892,7 +892,12 @@ class aci_show(crud.Retrieve):
),
)
- takes_options = (_prefix_option,)
+ takes_options = (
+ _prefix_option,
+ DNParam('location?',
+ label=_('Location of the ACI'),
+ )
+ )
def execute(self, aciname, **kw):
"""
@@ -905,7 +910,8 @@ class aci_show(crud.Retrieve):
"""
ldap = self.api.Backend.ldap2
- entry = ldap.get_entry(self.api.env.basedn, ['aci'])
+ dn = kw.get('location', self.api.env.basedn)
+ entry = ldap.get_entry(dn, ['aci'])
acis = _convert_strings_to_acis(entry.get('aci', []))