Impossible to list all flavors (including not public ones) with nova client

Bug #1190239 reported by Xavier Queralt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Unassigned

Bug Description

When trying to list all the flavors from the nova client (as admin) we get the following error:

$ nova flavor-list --all
ERROR: Invalid is_public filter [None] (HTTP 400) (Request-ID: req-6a0a5311-b4f1-492f-ade6-4801ab4dfcc8)

The problem relies in that nova client sends a 'None' string as the is_public attribute but the nova-api will only accept 'none' or any other form of string accepted by strutils.bool_from_string.

This error happens with python-novaclient and nova trunk

description: updated
Changed in nova:
assignee: nobody → Xavier Queralt (xqueralt)
status: New → In Progress
Revision history for this message
Xavier Queralt (xqueralt-deactivatedaccount) wrote :
Revision history for this message
Matt Riedemann (mriedem) wrote :

I'm running this version of the novaclient and can't recreate this:

[root@rhel62 ~]# nova --version
2.13.0.14

Can you point to the commit in the novaclient that added the --all support? I'm running as admin and get this:

[root@rhel62 ~]# nova flavor-list --all
usage: nova [--version] [--debug] [--os-cache] [--timings]
            [--timeout <seconds>] [--os-username <auth-user-name>]
            [--os-password <auth-password>]
            [--os-tenant-name <auth-tenant-name>] [--os-auth-url <auth-url>]
            [--os-region-name <region-name>] [--os-auth-system <auth-system>]
            [--service-type <service-type>] [--service-name <service-name>]
            [--volume-service-name <volume-service-name>]
            [--endpoint-type <endpoint-type>]
            [--os-compute-api-version <compute-api-ver>]
            [--os-cacert <ca-certificate>] [--insecure]
            [--bypass-url <bypass-url>]
            <subcommand> ...
error: unrecognized arguments: --all
Try 'nova help ' for more information.

Revision history for this message
Matt Riedemann (mriedem) wrote :

Nevermind, got the latest, I see the --all option and the failure. Confirmed.

Revision history for this message
Matt Riedemann (mriedem) wrote :

Added grizzly-backport-potential if anyone plans on using the latest novaclient with stable/grizzly.

tags: added: grizzly-backport-potential
Revision history for this message
Matt Riedemann (mriedem) wrote :

Now that I think about it, I wonder if the bug is novaclient and it should pass 'none' instead of 'None' to confirm with previous versions of the API code in nova.

Revision history for this message
Matt Riedemann (mriedem) wrote :

s/confirm/conform

Revision history for this message
Xavier Queralt (xqueralt-deactivatedaccount) wrote :

At first I thought the same, but because the bug was introduced after grizzly's release (See the commit https://github.com/openstack/nova/commit/1b9489fb0d556a2661c299cf67ed3d26ffcb2dce) I think the API should be kept consistent and fix it on nova's side.

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

Reviewed: https://review.openstack.org/32713
Committed: http://github.com/openstack/nova/commit/645c2d3a06bbf8b0854ebcc539ad33dd706866c5
Submitter: Jenkins
Branch: master

commit 645c2d3a06bbf8b0854ebcc539ad33dd706866c5
Author: Xavier Queralt <email address hidden>
Date: Wed Jun 12 14:59:29 2013 +0200

    Accept is_public=None when listing all flavors

    nova-client uses a None (with capital N) when listing all the flavors.
    Right now this is interpreted as a wrong query by n-api preventing us
    from listing the private flavors using the nova-client.

    Fixes bug #1190239

    Change-Id: I2a9b1c24cd744c8819c1d41e0ad103d05398401c

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-2
status: Fix Committed → Fix Released
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/39644

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Thierry Carrez (ttx)
Changed in nova:
milestone: havana-2 → 2013.2
Alan Pevec (apevec)
tags: removed: grizzly-backport-potential
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.