AttributeError - 'NoneType' object has no attribute 'lower'

Bug #1581667 reported by Adriano
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
High
Yosef Hoffman

Bug Description

When create a service with region = "None", occurs Error list services without horizon.

how to test
> create a service any with the region = None

Example:

+----------------------------------+-----------+--------------+----------------+---------+-----------+------------------------------------------+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
+----------------------------------+-----------+--------------+----------------+---------+-----------+------------------------------------------+
| 01089a905fec48ef957e77281c9aec92 | RegionOne | nova_legacy | compute_legacy | True | public | http://10.0.99.85:8774/v2/$(project_id)s |
| 1238174be563469fa1fd34fec099bcf8 | RegionOne | cinder | volume | True | admin | http://10.0.99.85:8776/v1/$(project_id)s |
| 22303c8d5b0340cda534f0fd33fd2ac3 | None | nova | image | True | public | http://10.0.99.85:500/v1/$(project_id)s |
-------------------------------------------------------------------------------------------------------------------------------------------------

> go to http://localhost/dashboard/admin/info/

horizon error

File "/opt/stack/horizon/openstack_dashboard/wsgi/../../openstack_dashboard/templatetags/context_selection.py", line 100, in <lambda>
AttributeError: 'NoneType' object has no attribute 'lower'
2016-05-11 16:59:02.554680 key=lambda x: x.lower()),

Adriano (dritec)
tags: added: low-hanging-fruit
Changed in horizon:
assignee: nobody → Yosef Hoffman (yh128t)
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/316847

Changed in horizon:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to horizon (master)

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

commit da2e93578f1f2b364ddb4d66e9311d225ab629d5
Author: Yosef Hoffman <email address hidden>
Date: Mon May 16 09:02:17 2016 -0400

    Fix AttributeError in context_selection.py

    When create a service with region = None,

    File "/openstack_dashboard/templatetags/context_selection.py", line 100,
    in <lambda>
    AttributeError: 'NoneType' object has no attribute 'lower'

    The problem code:

        sorted(request.user.available_services_regions,
               key=lambda x: x.lower())

    To fix this, if region is NoneType, use '' as key to put it first in the
    list.

    Change-Id: Ide8eaeeee634bf1933ef263d3b27204c7711d167
    Closes-Bug: #1581667

Changed in horizon:
status: In Progress → Fix Released
Changed in horizon:
milestone: none → newton-3
importance: Undecided → High
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/horizon 10.0.0.0b3

This issue was fixed in the openstack/horizon 10.0.0.0b3 development milestone.

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.