Non key=value values for 'allocation candidate list --resource' produce confusing output

Bug #1798823 reported by Stephen Finucane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
placement-osc-plugin
Fix Released
Medium
Stephen Finucane

Bug Description

# Overview

The 'openstack allocation candidate list' command requires one or more '--resource' arguments. These should be of key=value format (and arguably positional - not keyword - arguments, but that ship has sailed). There should be validation of this when running something like so:

  $ openstack allocation candidate list --resource VCPU

# Expected results

I should get a sane warning telling me to use key=value values.

# Actual result

The client blindly carries on only for placement to reject the request.

  $ openstack allocation candidate list --resource VCPU
  Badly formed resources parameter. Expected resources query string parameter in form: ?resources=VCPU:2,MEMORY_MB:1024. Got: VCPU. (HTTP 400)

Thankfully the reply is unambiguous but we shouldn't even get this far.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/osc-placement 1.4.0

This issue was fixed in the openstack/osc-placement 1.4.0 release.

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

Fixed in this change: https://review.openstack.org/#/c/611883/

stack@train:~/devstack$ openstack --os-placement-api-version 1.10 allocation candidate list --resource VCPU
Arguments to --resource must be of form <resource_class>=<value>
stack@train:~/devstack$ openstack --os-placement-api-version 1.10 allocation candidate list --resource VCPU=2
+---+------------+--------------------------------------+-------------------------+
| # | allocation | resource provider | inventory used/capacity |
+---+------------+--------------------------------------+-------------------------+
| 1 | VCPU=2 | 9a153de3-8e14-4d85-acba-6ea669fb9057 | VCPU=0/128 |
+---+------------+--------------------------------------+-------------------------+
stack@train:~/devstack$

Changed in placement-osc-plugin:
status: New → Fix Released
importance: Undecided → Medium
assignee: nobody → Stephen Finucane (stephenfinucane)
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.