python-novaclient/novaclient
Stephen Finucane 33627242e8 Stop silently ignoring invalid 'nova boot --hint' options
The '--hint' option for 'nova boot' expects a key-value pair like so:

  nova boot --hint group=245e1dfe-2d0e-4139-80a9-fce124948896 ...

However, the command doesn't complain if this isn't the case, meaning
typos like the below aren't indicated to the user:

  nova boot --hint 245e1dfe-2d0e-4139-80a9-fce124948896

Due to how we'd implemented this here, this ultimately results in us
POSTing the following as part of the body to 'os-servers':

  {
    ...
    "OS-SCH-HNT:scheduler_hints": {
      "245e1dfe-2d0e-4139-80a9-fce124948896": null
    }
    ...
  }

Which is unfortunately allowed and ignored by nova due to the use of
'additionalProperties' in the schema [1]

Do what we do for loads of other options and explicitly fail on invalid
values.

NOTE(stephenfin): This includes the release note first added separately
in change I753e9a0cda1e118578373c519cf2fb2dd605a623.

[1] https://github.com/openstack/nova/blob/19.0.0/nova/api/openstack/compute/schemas/servers.py#L142-L146

Change-Id: I0f9f75cba68e7582d32d4aab2f8f077b4360d386
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Closes-Bug: #1845322
(cherry picked from commit 6954aacd54)
2019-10-01 15:58:21 +01:00
..
tests Stop silently ignoring invalid 'nova boot --hint' options 2019-10-01 15:58:21 +01:00
v2 Stop silently ignoring invalid 'nova boot --hint' options 2019-10-01 15:58:21 +01:00
__init__.py Microversion 2.79: Add delete_on_termination to volume-attach API 2019-09-09 12:43:42 -04:00
api_versions.py Update hacking version 2019-01-04 14:46:07 +08:00
base.py Use SHA256 instead of MD5 in completion cache 2019-05-09 15:32:33 -04:00
client.py Remove deprecated methods and properties 2019-07-04 04:06:42 +00:00
crypto.py Fixes Python3 issue in decoding password 2018-10-26 11:06:44 +09:00
exceptions.py Remove deprecated methods and properties 2019-07-04 04:06:42 +00:00
extension.py Cleanup needless code from oslo-incubator 2015-12-18 08:46:12 +00:00
i18n.py Update URLs in docs, comments and setup.cfg 2017-07-28 12:14:12 +09:00
shell.py Remove deprecated options 2019-03-21 13:50:41 +00:00
utils.py Merge "Use uuidutils of oslo.utils" 2018-08-08 18:00:11 +00:00