← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1581667] Re: AttributeError - 'NoneType' object has no attribute 'lower'

 

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 <yh128t@xxxxxxx>
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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1581667

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

Status in OpenStack Dashboard (Horizon):
  Fix Released

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()),

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1581667/+subscriptions


References