commit 9448291d8f3ff6bef85d3bca4aa21c1e6036b3f1
Author: Johannes Kulik <email address hidden>
Date: Thu Feb 27 08:08:32 2020 +0100
Validate id as integer for os-aggregates
According to the api-ref, the id passed to calls in os-aggregates is
supposed to be an integer. No function validated this, so any value
passed to these functions would directly reach the DB. While this is
fine for SQLite, making a query with a string for an integer column on
other databases like PostgreSQL results in a DBError exception and thus
a HTTP 500 instead of 400 or 404.
This commit adds validation for the id parameter the same way it's
already done for other endpoints.
Change-Id: I83817f7301680801beaee375825f02eda526eda1
Closes-Bug: 1865040
(cherry picked from commit 2e70a1717f25652912886cbefa3f40e6df908c00)
(cherry picked from commit 4653245ddcf989ebac4b964a41d881d78cf9ae2c)
Reviewed: https:/ /review. opendev. org/c/openstack /nova/+ /764308 /opendev. org/openstack/ nova/commit/ 9448291d8f3ff6b ef85d3bca4aa21c 1e6036b3f1
Committed: https:/
Submitter: "Zuul (22348)"
Branch: stable/stein
commit 9448291d8f3ff6b ef85d3bca4aa21c 1e6036b3f1
Author: Johannes Kulik <email address hidden>
Date: Thu Feb 27 08:08:32 2020 +0100
Validate id as integer for os-aggregates
According to the api-ref, the id passed to calls in os-aggregates is
supposed to be an integer. No function validated this, so any value
passed to these functions would directly reach the DB. While this is
fine for SQLite, making a query with a string for an integer column on
other databases like PostgreSQL results in a DBError exception and thus
a HTTP 500 instead of 400 or 404.
This commit adds validation for the id parameter the same way it's
already done for other endpoints.
Change-Id: I83817f73016808 01beaee375825f0 2eda526eda1 912886cbefa3f40 e6df908c00) bac4b964a41d881 d78cf9ae2c)
Closes-Bug: 1865040
(cherry picked from commit 2e70a1717f25652
(cherry picked from commit 4653245ddcf989e