Reviewed: https://review.opendev.org/684762 Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=6954aacd54e85859fecde22ac04db1ce7601dd35 Submitter: Zuul Branch: master
commit 6954aacd54e85859fecde22ac04db1ce7601dd35 Author: Stephen Finucane <email address hidden> Date: Wed Sep 25 12:10:21 2019 +0100
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.
[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 <email address hidden> Closes-Bug: #1845322
Reviewed: https:/ /review. opendev. org/684762 /git.openstack. org/cgit/ openstack/ python- novaclient/ commit/ ?id=6954aacd54e 85859fecde22ac0 4db1ce7601dd35
Committed: https:/
Submitter: Zuul
Branch: master
commit 6954aacd54e8585 9fecde22ac04db1 ce7601dd35
Author: Stephen Finucane <email address hidden>
Date: Wed Sep 25 12:10:21 2019 +0100
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-fce1249488 96 ...
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-fce1249488 96
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-fce1249488 96": null
...
}
...
}
Which is unfortunately allowed and ignored by nova due to the use of Properties' in the schema [1]
'additional
Do what we do for loads of other options and explicitly fail on invalid
values.
[1] https:/ /github. com/openstack/ nova/blob/ 19.0.0/ nova/api/ openstack/ compute/ schemas/ servers. py#L142- L146
Change-Id: I0f9f75cba68e75 82d32d4aab2f8f0 77b4360d386
Signed-off-by: Stephen Finucane <email address hidden>
Closes-Bug: #1845322