Bug 1644747 - [OSP13] novajoin-ipa-setup fails with AttributeError: 'module' object has no attribute 'get_handler'
Summary: [OSP13] novajoin-ipa-setup fails with AttributeError: 'module' object has no ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-novajoin
Version: 13.0 (Queens)
Hardware: Unspecified
OS: Unspecified
high
urgent
Target Milestone: z4
: 13.0 (Queens)
Assignee: Ade Lee
QA Contact: Pavan
URL:
Whiteboard:
Depends On: 1645136 1647772 1653312
Blocks: 1613161 1613576 1619819 1622182 1639273
TreeView+ depends on / blocked
 
Reported: 2018-10-31 14:17 UTC by Jeremy Agee
Modified: 2023-09-15 00:13 UTC (History)
22 users (show)

Fixed In Version: python-novajoin-1.0.21-1.el7ost
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1645136 (view as bug list)
Environment:
Last Closed: 2019-01-16 17:53:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 614875 0 None MERGED Fix novajoin-ipa-setup to set logging correctly 2020-08-25 10:45:01 UTC
RDO 17390 0 None master: MERGED rdoinfo: Update novajoin to 1.0.21 for rocky-release and queens-release (Ib9081f605c290d7fb58466f20ec9969a58ea72e6) 2018-11-29 14:47:07 UTC
RDO 17584 0 None master: NEW rdoinfo: Add Source-branch entries for novajoin (I61884576a80dd646c6067f01dca1b916410368d8) 2018-11-29 14:47:01 UTC
Red Hat Issue Tracker OSP-1348 0 None None None 2021-12-10 18:09:13 UTC
Red Hat Product Errata RHBA-2019:0088 0 None None None 2019-01-16 17:54:14 UTC

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


Note You need to log in before you can comment on or make changes to this bug.