magnum fails if a token is specified

Bug #1793274 reported by Giovanni Pizzi on 2018-09-19
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

If I have OS_TOKEN set in the environment, and I run for instance
a "magnum cluster-template-create ..." command, I get the following error:

ERROR: __init__() got an unexpected keyword argument 'token'

I dug this a bit: the reason is that in OpenStackMagnumShell.main()
no "auth_type" is passed in the kwargs to client.Client (when setting self.cs), but
the default value for "auth_type" is hardcoded to "password" in the __init__ of the
Client class.

A possible solution would be to add the following three lines right above the call
to set self.cs in the main() method:

        # If a token is specified, use a 'token' auth-type
        if args.os_token:
            kwargs["auth_type"] = "token"

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

Other bug subscribers