TypeError in nova-manage cell_v2 list_cells if a cell does not have a name

Bug #1790695 reported by Matt Riedemann
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Matt Riedemann
Ocata
New
Undecided
Unassigned
Pike
New
Undecided
Unassigned
Queens
New
Undecided
Unassigned
Rocky
New
Undecided
Unassigned

Bug Description

This was reported in IRC:

nova-manage cell_v2 list_cells
An error has occurred:
Traceback (most recent call last):
  File "/usr/lib64/python3.5/site-packages/nova/cmd/manage.py", line 2303, in main
    ret = fn(*fn_args, **fn_kwargs)
  File "/usr/lib64/python3.5/site-packages/nova/cmd/manage.py", line 1484, in list_cells
    for cell in sorted(cell_mappings, key=lambda _cell: _cell.name):
TypeError: unorderable types: NoneType() < str()

That happened because one of the cells didn't have a name and --name is optional in the create_cell command.

Matt Riedemann (mriedem)
Changed in nova:
assignee: nobody → Matt Riedemann (mriedem)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

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

Reviewed: https://review.openstack.org/599861
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=a4f1274f40513d0a350a38c6e389c9a76c272379
Submitter: Zuul
Branch: master

commit a4f1274f40513d0a350a38c6e389c9a76c272379
Author: Matt Riedemann <email address hidden>
Date: Tue Sep 4 18:28:21 2018 -0400

    Fix TypeError in nova-manage cell_v2 list_cells

    Cell mappings don't require a name, so when listing
    cells, if any mappings don't have a name, the sorted
    function will fail with a TypeError since you can't compare
    None to a string.

    This fixes the issue by using the empty string if the cell
    mapping name is None.

    Change-Id: I4fc9d8d1a96f1ec722c2c92dead3f5c4c94d4382
    Closes-Bug: #1790695

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 19.0.0.0rc1

This issue was fixed in the openstack/nova 19.0.0.0rc1 release candidate.

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.