Thursday, August 27, 2020

[389-commits] [389-ds-base] branch 389-ds-base-1.4.3 updated: Issue 51228 - Fix lock/unlock wording and lib389 use of methods

This is an automated email from the git hooks/post-receive script.

spichugi pushed a commit to branch 389-ds-base-1.4.3
in repository 389-ds-base.

The following commit(s) were added to refs/heads/389-ds-base-1.4.3 by this push:
new 2cd634e Issue 51228 - Fix lock/unlock wording and lib389 use of methods
2cd634e is described below

commit 2cd634ebe5fac2c8fbebe4871ea16c1f402ed64d
Author: Simon Pichugin <spichugi@redhat.com>
AuthorDate: Thu Aug 27 14:06:37 2020 +0200

Issue 51228 - Fix lock/unlock wording and lib389 use of methods

Descriptions: Clean up lib389 idm-account methods to presicely locate
CoS objects. Also, fix AccountPolicyEntry super() function.
Fix wording in user input requests while doing lock/unlock.

https://pagure.io/389-ds-base/issue/51228

Reviewed by: mreynolds (Thanks!)
---
src/lib389/lib389/cli_idm/account.py | 4 ++--
src/lib389/lib389/idm/account.py | 4 +++-
src/lib389/lib389/plugins.py | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/lib389/lib389/cli_idm/account.py b/src/lib389/lib389/cli_idm/account.py
index 960eb8e..3e9f37e 100644
--- a/src/lib389/lib389/cli_idm/account.py
+++ b/src/lib389/lib389/cli_idm/account.py
@@ -96,7 +96,7 @@ def subtree_status(inst, basedn, log, args):


def lock(inst, basedn, log, args):
- dn = _get_dn_arg(args.dn, msg="Enter dn to check")
+ dn = _get_dn_arg(args.dn, msg="Enter dn to lock")
accounts = Accounts(inst, basedn)
acct = accounts.get(dn=dn)
acct.lock()
@@ -104,7 +104,7 @@ def lock(inst, basedn, log, args):


def unlock(inst, basedn, log, args):
- dn = _get_dn_arg(args.dn, msg="Enter dn to check")
+ dn = _get_dn_arg(args.dn, msg="Enter dn to unlock")
accounts = Accounts(inst, basedn)
acct = accounts.get(dn=dn)
acct.unlock()
diff --git a/src/lib389/lib389/idm/account.py b/src/lib389/lib389/idm/account.py
index c772b66..666b623 100644
--- a/src/lib389/lib389/idm/account.py
+++ b/src/lib389/lib389/idm/account.py
@@ -105,7 +105,9 @@ class Account(DSLdapObject):
spec_attr = self._dict_get_with_ignore_indexerror(config_settings, "specattrname")
limit_attr = self._dict_get_with_ignore_indexerror(config_settings, "limitattrname")

- cos_entries = CosTemplates(inst, self.dn)
+ mapping_trees = MappingTrees(inst)
+ root_suffix = mapping_trees.get_root_suffix_by_entry(self.dn)
+ cos_entries = CosTemplates(inst, root_suffix)
accpol_entry_dn = ""
for cos in cos_entries.list():
if cos.present(spec_attr):
diff --git a/src/lib389/lib389/plugins.py b/src/lib389/lib389/plugins.py
index 89e6602..e7ef2df 100644
--- a/src/lib389/lib389/plugins.py
+++ b/src/lib389/lib389/plugins.py
@@ -1881,7 +1881,7 @@ class AccountPolicyEntry(DSLdapObject):
"""

def __init__(self, instance, dn=None):
- super(AccountPolicyConfig, self).__init__(instance, dn)
+ super(AccountPolicyEntry, self).__init__(instance, dn)
self._rdn_attribute = 'cn'
self._must_attributes = ['cn']
self._create_objectclasses = ['top', 'accountpolicy']

--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
389-commits mailing list -- 389-commits@lists.fedoraproject.org
To unsubscribe send an email to 389-commits-leave@lists.fedoraproject.org
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/389-commits@lists.fedoraproject.org

No comments:

Post a Comment