#50374 dsdim posixgroup create fails with ERROR: Error: 'Namespace' object has no attribute 'extra'
Closed: wontfix by vashirov. Opened by vashirov.

Issue Description

[root@server-f30 ds]# /usr/sbin/dsidm -v test -D cn=directory\ manager -w password  -b dc=example,dc=com  posixgroup create --cn test 
DEBUG: The 389 Directory Server Identity Manager
DEBUG: Inspired by works of: ITS, The University of Adelaide
DEBUG: dsrc path: /root/.dsrc
DEBUG: dsrc instances: []
DEBUG: dsrc no such section test
DEBUG: Called with: Namespace(basedn='dc=example,dc=com', binddn='cn=directory manager', bindpw='password', cn='test', func=<function create at 0x7f584be2a950>, gidNumber=None, instance='test', json=False, prompt=False, pwdfile=None, starttls=False, verbose=True)
DEBUG: Instance details: {'uri': 'test', 'basedn': 'dc=example,dc=com', 'binddn': 'cn=directory manager', 'saslmech': None, 'tls_cacertdir': None, 'tls_cert': None, 'tls_key': None, 'tls_reqcert': 1, 'starttls': False, 'args': {'ldapurl': 'test', 'root-dn': 'cn=directory manager'}}
DEBUG: Allocate <class 'lib389.DirSrv'> with ldapi://%2fvar%2frun%2fslapd-test.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with %2fvar%2frun%2fslapd-test.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with server-f30.example.com:389
DEBUG: Allocate <class 'lib389.DirSrv'> with server-f30.example.com:389
DEBUG: Allocate <class 'lib389.DirSrv'> with ldapi://%2fvar%2frun%2fslapd-test.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with %2fvar%2frun%2fslapd-test.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with server-f30.example.com:389
DEBUG: Allocate <class 'lib389.DirSrv'> with server-f30.example.com:389
DEBUG: open(): Connecting to uri ldapi://%2fvar%2frun%2fslapd-test.socket
DEBUG: Using dirsrv ca certificate /etc/dirsrv/slapd-test
DEBUG: Using external ca certificate /etc/dirsrv/slapd-test
DEBUG: Using external ca certificate /etc/dirsrv/slapd-test
DEBUG: Using certificate policy 1
DEBUG: ldap.OPT_X_TLS_REQUIRE_CERT = 1
DEBUG: open(): Using root autobind ...
DEBUG: open(): bound as cn=directory manager
DEBUG: 'Namespace' object has no attribute 'extra'
Traceback (most recent call last):
  File "/usr/sbin/dsidm", line 127, in <module>
    result = args.func(inst, dsrc_inst['basedn'], log, args)
  File "/usr/lib/python3.7/site-packages/lib389/cli_idm/posixgroup.py", line 42, in create
    kwargs = _get_attributes(args.extra, MUST_ATTRIBUTES)
AttributeError: 'Namespace' object has no attribute 'extra'
ERROR: Error: 'Namespace' object has no attribute 'extra'

Problem goes away with

diff --git a/src/lib389/lib389/cli_idm/posixgroup.py b/src/lib389/lib389/cli_idm/posixgroup.py
index 87c951a81..5213985c6 100644
--- a/src/lib389/lib389/cli_idm/posixgroup.py
+++ b/src/lib389/lib389/cli_idm/posixgroup.py
@@ -39,7 +39,7 @@ def get_dn(inst, basedn, log, args):
     _generic_get_dn(inst, basedn, log.getChild('_generic_get_dn'), MANY, dn, args)
 def create(inst, basedn, log, args):
-    kwargs = _get_attributes(args.extra, MUST_ATTRIBUTES)
+    kwargs = _get_attributes(args, MUST_ATTRIBUTES)
     _generic_create(inst, basedn, log.getChild('_generic_create'), MANY, kwargs, args)
 def delete(inst, basedn, log, args):

Metadata Update from @vashirov:
- Custom field origin adjusted to None
- Custom field reviewstatus adjusted to None

Metadata Update from @vashirov:
- Issue tagged with: lib389

Commit 2c51eeb4 fixes this issue

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/389ds/389-ds-base/issues/3433

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Metadata Update from @spichugi:
- Issue close_status updated to: wontfix (was: Fixed)

Metadata
Related Pull Requests