[py3] novajoin-ipa-setup fails trying to decode('UTF-8') a string

Bug #1820961 reported by Luca Miccini
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
novajoin
New
Undecided
Unassigned

Bug Description

while testing on a py3 host I got the following error:

Traceback (most recent call last):
  File "/usr/bin/novajoin-ipa-setup", line 103, in <module>
    args['tls_ca_cert'] = cafile.decode('UTF-8')
AttributeError: 'str' object has no attribute 'decode'

in:

    if precreate_opts_specified:
        # IPA v4.5.0 switched client from NSS to OpenSSL
        if version.NUM_VERSION >= 40500:
            cafile = novajoin.create_cafile(opts.server, opts.realm)
            # Workaround for https://pagure.io/freeipa/issue/7145
            args['tls_ca_cert'] = cafile.decode('UTF-8')
        else:
            nss_db = novajoin.create_nssdb(opts.server, opts.realm)
args['nss_dir'] = nss_db.secdir.decode('UTF-8')

if I remove the decode() it seems to work fine.

Revision history for this message
Luca Miccini (lmiccini2) wrote :
Revision history for this message
Luca Miccini (lmiccini2) wrote :

with https://review.openstack.org/#/c/644785/ we correctly get past this error.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers