← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1784782] Re: API: flavors - Cannot list all public and private flavors by default

 

Is your bug really about saying that admins shouldn't have to pass
is_public=None *by default* and is_public=None should just be the
default behavior for admins if the is_public query parameter isn't
provided? If so, that's not a bug, and would require a microversion
since it's a behavior change to the API.

** Changed in: nova
       Status: New => Opinion

** Changed in: nova
   Importance: Undecided => Wishlist

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

Title:
  API: flavors - Cannot list all public and private flavors by default

Status in OpenStack Compute (nova):
  Opinion

Bug description:
  The API doesn't return all public and private flavors by default.
  Effectively only public flavors are listed even though the default policy rule authorize it.

  Here I'm using 'admin' user/project along with no explicit policy
  therefore relying on the default 'built-in' policy which I believe
  translate to "compute_extension:flavor_access:addTenantAccess":
  "rule:admin_api".

  $ openstack flavor list --all
  +--------------------------------------+-------------+-----+------+-----------+-------+-----------+
  | ID                                   | Name        | RAM | Disk | Ephemeral | VCPUs | Is Public |
  +--------------------------------------+-------------+-----+------+-----------+-------+-----------+
  | 1                                    | flavor-tiny |  64 |    0 |         0 |     1 | True      |
  | a1fec2c4-2f18-422b-977d-c7e2046cfaec | test1       |   1 |    1 |         0 |     1 | False     |
  +--------------------------------------+-------------+-----+------+-----------+-------+-----------+

  
  # The default flavors list returns only the public ones:
  $ curl -s -H "X-Auth-Token: $OS_TOKEN" -H "Content-Type: application/json" http://${OS_HOST}:8774/v2/flavors| python -mjson.tool
  {
      "flavors": [
          {
              "id": "1",
              "links": [
                  {
                      "href": "http://192.0.2.6:8774/v2/flavors/1";,
                      "rel": "self"
                  },
                  {
                      "href": "http://192.0.2.6:8774/flavors/1";,
                      "rel": "bookmark"
                  }
              ],
              "name": "flavor-tiny"
          }
      ]
  }

  $ curl -s -H "X-Auth-Token: $OS_TOKEN" -H "Content-Type: application/json" http://${OS_HOST}:8774/v2/flavors?is_public=false | python -mjson.tool                                                                                                
  {
      "flavors": [
          {
              "id": "a1fec2c4-2f18-422b-977d-c7e2046cfaec",
              "links": [
                  {
                      "href": "http://192.0.2.6:8774/v2/flavors/a1fec2c4-2f18-422b-977d-c7e2046cfaec";,
                      "rel": "self"
                  },
                  {
                      "href": "http://192.0.2.6:8774/flavors/a1fec2c4-2f18-422b-977d-c7e2046cfaec";,
                      "rel": "bookmark"
                  }
              ],
              "name": "test1"
          }
      ]
  }

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


References