Neutron logged out TypeError

Bug #1279979 reported by Matthew D. Wood
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Matthew D. Wood

Bug Description

If a users's token is not valid, the neutron client will raise a

TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

This TypeError should really be an neutronclient.common.exceptions.Unauthorized instead.

The TypeError is a result of a neutron_client.Client having it's auth_url set to None; which, unfortunately, is the default.

This can be recreated by logging in, and opening up a 2nd tab/window. Logout in one window. In the other window, go to a page that requires a neutron-api call (the networking page comes to mind).

Tags: neutron
Changed in horizon:
assignee: nobody → Matthew D. Wood (woodm1979)
Revision history for this message
Matthew D. Wood (woodm1979) wrote :

It's worth noting: the fix is to pass in a correct auth_url, but know that the authenticate call that will use that auth_url WILL FAIL. (... because we don't keep the user's password.)

That's the correct behavior, and the failed authenticate() call will bubble up a neutronclient.common.exceptions.Unauthorized exception instead of a TypeError. That exception will be caught correctly higher up.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

Fix proposed to branch: master
Review: https://review.openstack.org/73420

Changed in horizon:
status: New → In Progress
David Lyle (david-lyle)
Changed in horizon:
importance: Undecided → High
importance: High → Medium
David Lyle (david-lyle)
Changed in horizon:
milestone: none → icehouse-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

Reviewed: https://review.openstack.org/73420
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=d8bb6fe0952f38bc6b670b424501b96e4813df33
Submitter: Jenkins
Branch: master

commit d8bb6fe0952f38bc6b670b424501b96e4813df33
Author: woodm1979 <email address hidden>
Date: Thu Feb 13 14:27:23 2014 -0700

    1279979 Neutron TypeError when token invalid

    When a neutron api-call is made, if the user's token is invalid, the
    neutron client will return a type-error because no auth_url has been
    provided.

    TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'

    This TypeError should really be an
    neutronclient.common.exceptions.Unauthorized instead, which will get
    percolated up via a password-base authentication failure.

    Change-Id: I284e5cdf943fc63faf8509fdbe3caa45179d5f71
    Closes-Bug: 1279979

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: icehouse-3 → 2014.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.