Bug 1644747

Summary: [OSP13] novajoin-ipa-setup fails with AttributeError: 'module' object has no attribute 'get_handler'
Product: Red Hat OpenStack Reporter: Jeremy Agee <jagee>
Component: python-novajoinAssignee: Ade Lee <alee>
Status: CLOSED ERRATA QA Contact: Pavan <pkesavar>
Severity: urgent Docs Contact:
Priority: high    
Version: 13.0 (Queens)CC: agurenko, alee, dvd, hrybacki, jgrosso, josorior, jschluet, jzaher, kbasil, kmehta, mariel, marjones, mazovladimir, mcornea, mkrcmari, mschuppe, nkinder, rcritten, rmascena, sputhenp, svigan, wznoinsk
Target Milestone: z4Keywords: Rebase, Triaged, ZStream
Target Release: 13.0 (Queens)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python-novajoin-1.0.21-1.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1645136 (view as bug list) Environment:
Last Closed: 2019-01-16 17:53:54 UTC 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: 1645136, 1647772, 1653312    
Bug Blocks: 1613161, 1613576, 1619819, 1622182, 1639273    

Description Jeremy Agee 2018-10-31 14:17:49 UTC
Description of problem:
novajoin-ipa-setup fails with the following traceback.

Traceback (most recent call last):
File "/usr/libexec/novajoin-ipa-setup", line 70, in <module>
    console = log_mgr.get_handler('console')
AttributeError: 'module' object has no attribute 'get_handler'

Version-Release number of selected component (if applicable):
RHEL7.6
python-novajoin-1.0.18-2.el7ost.noarch

Steps to Reproduce:
1. install python-novajoin on RHEL7.6
2. run a join to create the OTP
/usr/libexec/novajoin-ipa-setup --principal admin --password 12345678 --server freeipa-0.redhat.local --realm REDHAT.LOCAL --domain redhat.local --hostname undercloud-0.redhat.local --precreate

Actual results:
novajoin-ipa-setup returns a traceback

Expected results:
The undercloud is joined to IPA and a OTP is returned.

Comment 2 Juan Antonio Osorio 2018-10-31 16:21:40 UTC
Seems this bug was introduced by a change in the IPA client libraries. I was pointed to this commit in freeipa f62a0fdb904d2a4bb1961847e240dbb6df3b0b67 [1]

We need to make sure that this works with both the old interface (the current code base) and the newer interface (RHEL 7.5 and 7.6)

[1] https://github.com/freeipa/freeipa/commit/f62a0fdb904d2a4bb1961847e240dbb6df3b0b67

Comment 3 Rob Crittenden 2018-10-31 20:19:16 UTC
This was done to suppress the message "[try %d]: Forwarding '%s' to %s server '%s'" when using the API

You can make this version-specific with something like:

from ipapython import version

if version.NUM_VERSION < 40600:
    from ipapython.ipa_log_manager import log_mgr   
    console = log_mgr.get_handler('console')
    console.setLevel(logging.WARN)
elif version.NUM_VERSION < 40700:
    ...something...

In 4.7.0 the Forwarding is a debug level message so nothing special is needed.

The something is probably going to be a somewhat ugly hack. There are no named handlers so you'll need to iterate through root_handler.handlers to find the StreamHandler for the console.

You might be able to, for example, look for handler.stream.name == '<stderr>'...

Or live with the Forwarding message. It doesn't hurt anything I just felt it was ugly.

Comment 4 Marian Krcmarik 2018-11-01 10:50:31 UTC
This has significant impact on tls-everywhere topology on all OSP versions which are about to switch to RHEL7.6 (OSP12/13/14).

The command (i.e.):
"/usr/libexec/novajoin-ipa-setup --principal admin --password 12345678 --server freeipa-0.redhat.local --realm REDHAT.LOCAL --domain redhat.local --hostname undercloud-0.redhat.local --precreate"
fails on mentioned AttributeError.

Comment 10 Harry Rybacki 2018-11-19 17:00:56 UTC
Adding external tracker for RDO patch that bumps novajoin version.

Comment 11 Harry Rybacki 2018-11-19 18:07:40 UTC
Removing abandoned patch, adding new one.

Comment 31 errata-xmlrpc 2019-01-16 17:53:54 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:0088

Comment 32 Red Hat Bugzilla 2023-09-15 00:13:32 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days