Bug 2189717

Summary: dsconf ERROR: Error: name 'log' is not defined
Product: Red Hat Enterprise Linux 9 Reporter: Rob Crittenden <rcritten>
Component: 389-ds-baseAssignee: LDAP Maintainers <idm-ds-dev-bugs>
Status: VERIFIED --- QA Contact: LDAP QA Team <idm-ds-qe-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 9.2CC: bsmejkal, idm-ds-dev-bugs, minfrin, mreynolds, tbordaz, vashirov
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: 9.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sync-to-jira
Fixed In Version: 389-ds-base-2.3.4-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2224503 (view as bug list) Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2224503    

Description Rob Crittenden 2023-04-26 00:15:19 UTC
Description of problem:

Trying to change a security parameter ends with the error: name 'log' is not defined

# dsconf -v slapd-EXAMPLE-TEST security set --tls-protocol-min=TLS1.0
DEBUG: The 389 Directory Server Configuration Tool
DEBUG: Inspired by works of: ITS, The University of Adelaide
DEBUG: dsrc path: /root/.dsrc
DEBUG: dsrc container path: /data/config/container.inf
DEBUG: dsrc instances: []
DEBUG: dsrc no such section: slapd-EXAMPLE-TEST
DEBUG: Called with: Namespace(instance='slapd-EXAMPLE-TEST', verbose=True, binddn=None, bindpw=None, prompt=False, pwdfile=None, basedn=None, starttls=False, json=False, security=None, listen_host=None, secure_port=None, tls_client_auth=None, tls_client_renegotiation=None, require_secure_authentication=None, check_hostname=None, verify_cert_chain_on_startup=None, session_timeout=None, tls_protocol_min='TLS1.0', tls_protocol_max=None, allow_insecure_ciphers=None, allow_weak_dh_param=None, cipher_pref=None, func=<function _security_generic_set_parser.<locals>.<lambda> at 0x7fec1abd85e0>)
DEBUG: Instance details: {'uri': 'slapd-EXAMPLE-TEST', 'basedn': None, 'binddn': None, 'bindpw': None, 'saslmech': None, 'tls_cacertdir': None, 'tls_cert': None, 'tls_key': None, 'tls_reqcert': None, 'starttls': False, 'prompt': False, 'pwdfile': None, 'args': {'ldapurl': 'slapd-EXAMPLE-TEST', 'root-dn': None}}
DEBUG: Allocate <class 'lib389.DirSrv'> with ldapi://%2frun%2fslapd-EXAMPLE-TEST.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with %2frun%2fslapd-EXAMPLE-TEST.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with %2frun%2fslapd-EXAMPLE-TEST.socket:None
DEBUG: Allocate <class 'lib389.DirSrv'> with %2frun%2fslapd-EXAMPLE-TEST.socket:None
DEBUG: Allocate <class 'lib389.DirSrv'> with ldapi://%2frun%2fslapd-EXAMPLE-TEST.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with %2frun%2fslapd-EXAMPLE-TEST.socket
DEBUG: Allocate <class 'lib389.DirSrv'> with %2frun%2fslapd-EXAMPLE-TEST.socket:None
DEBUG: Allocate <class 'lib389.DirSrv'> with %2frun%2fslapd-EXAMPLE-TEST.socket:None
DEBUG: open(): Connecting to uri ldapi://%2frun%2fslapd-EXAMPLE-TEST.socket
DEBUG: Using dirsrv ca certificate /etc/dirsrv/slapd-EXAMPLE-TEST
DEBUG: Using external ca certificate /etc/dirsrv/slapd-EXAMPLE-TEST
DEBUG: Using /etc/openldap/ldap.conf certificate policy
DEBUG: ldap.OPT_X_TLS_REQUIRE_CERT = 2
DEBUG: open(): Using root autobind ...
DEBUG: open(): bound as None
DEBUG: Retrieving entry with [('',)]
DEBUG: Retrieved entry [dn: 
vendorVersion: 389-Directory/2.2.4 B2022.347.0000

]
DEBUG: cn=encryption,cn=config set REPLACE: ('sslVersionMin', 'TLS1.0')
DEBUG: name 'log' is not defined
Traceback (most recent call last):
  File "/usr/sbin/dsconf", line 138, in <module>
    result = args.func(inst, None, log, args)
  File "/usr/lib/python3.9/site-packages/lib389/cli_conf/security.py", line 113, in <lambda>
    p.set_defaults(func=lambda *args: _security_generic_set(*args, attrs_map))
  File "/usr/lib/python3.9/site-packages/lib389/cli_conf/security.py", line 102, in _security_generic_set
    log.info(f"Successfully updated security configuration ({props.attr})")
NameError: name 'log' is not defined
ERROR: Error: name 'log' is not defined

Version-Release number of selected component (if applicable):

389-ds-base-2.2.4-3.el9.x86_64

How reproducible:

Every time. It does successfully update dse.ldif.

Steps to Reproduce:
1. I found it after installing IPA
2. dsconf -v slapd-EXAMPLE-TEST security set --tls-protocol-min=TLS1.0

Comment 4 Graham Leggett 2023-06-06 08:42:41 UTC
Just hit this issue, breaks our automation. Is there an update?

Comment 7 Viktor Ashirov 2023-07-21 07:58:21 UTC
Moving to MODIFIED, as the fix was picked up by the rebase in 9.3. 
It will be fixed in 9.2.z in https://bugzilla.redhat.com/show_bug.cgi?id=2224503

Comment 10 Viktor Ashirov 2023-08-04 07:45:35 UTC
Moving to VERIFIED according to comment #7