nova/nova
Johannes Kulik 4653245ddc 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.

Conflicts:
  nova/api/openstack/compute/aggregates.py

Changes:
  nova/tests/unit/api/openstack/compute/test_aggregates.py

NOTE(stephenfin): Conflicts are due to absence of change
I4ab96095106b38737ed355fcad07e758f8b5a9b0 ("Add image caching API for
aggregates") which we don't want to backport. A test related to this
feature must also be removed.

Change-Id: I83817f7301680801beaee375825f02eda526eda1
Closes-Bug: 1865040
(cherry picked from commit 2e70a1717f)
2020-11-27 12:19:10 +00:00
..
api Validate id as integer for os-aggregates 2020-11-27 12:19:10 +00:00
cmd Print help if nova-manage subcommand is not specified 2020-01-15 10:29:02 +00:00
compute Merge "compute: Validate a BDMs disk_bus when provided" into stable/train 2020-10-23 19:34:06 +00:00
conductor Sanity check instance mapping during scheduling 2020-09-16 17:13:44 +00:00
conf add [libvirt]/max_queues config option 2020-07-08 16:22:10 +00:00
console Mask the token used to allow access to consoles 2019-11-29 11:40:44 +00:00
db Fix instance.hidden migration and querying 2020-02-07 09:13:44 -08:00
hacking Add a hacking rule for useless assertions 2019-08-21 14:42:53 +09:00
image [Trivial]Removed unused helper _extract_query_params 2019-08-29 10:12:52 +08:00
ipv6
keymgr
locale Imported Translations from Zanata 2019-11-19 06:43:07 +00:00
network Add config option for neutron client retries 2020-03-25 17:26:37 +00:00
notifications Update api-ref location 2019-07-22 19:17:28 +02:00
objects compute: Validate a BDMs disk_bus when provided 2020-09-03 15:24:37 +01:00
pci hacking: Resolve W605 (invalid escape sequence) 2019-06-24 14:24:06 -05:00
policies Add server sub-resource topology API 2019-08-30 10:04:56 +08:00
privsep libvirt: Support VM creation with vpmems and vpmems cleanup 2019-09-13 08:50:35 +00:00
scheduler FUP for in-place numa rebuild 2019-12-20 12:09:04 +00:00
servicegroup [Trivial fix]Remove unnecessary slash 2019-05-06 16:23:59 +08:00
tests Validate id as integer for os-aggregates 2020-11-27 12:19:10 +00:00
virt Merge "add [libvirt]/max_queues config option" into stable/train 2020-11-13 20:06:13 +00:00
vnc xvp: Remove use of '_LI' marker 2019-06-19 10:04:45 +01:00
volume Add retry to cinder API calls related to volume detach 2020-04-22 16:54:47 -04:00
__init__.py Eventlet monkey patching should be as early as possible 2019-03-22 09:27:16 +00:00
availability_zones.py Always pass HostAPI to get_availability_zones 2019-04-26 15:30:48 -04:00
baserpc.py
block_device.py hacking: Resolve W605 (invalid escape sequence) 2019-06-24 14:24:06 -05:00
cache_utils.py
config.py Silence amqp heartbeat warning 2020-07-30 16:36:18 +00:00
context.py Reset the cell cache for database access in Service 2020-04-10 22:31:20 +00:00
crypto.py
debugger.py
exception.py Merge "compute: Validate a BDMs disk_bus when provided" into stable/train 2020-10-23 19:34:06 +00:00
exception_wrapper.py
filters.py filters: Stop handling cells v1 2019-06-12 16:09:46 +01:00
hooks.py
i18n.py
loadables.py
manager.py
middleware.py Rename 'nova.common.config' module to 'nova.middleware' 2019-08-16 00:53:03 +01:00
monkey_patch.py Correctly disable greendns 2020-09-13 18:30:35 -04:00
policy.py Move default policy target 2019-06-03 16:44:50 +01:00
profiler.py
quota.py Make quotas respect instance_list_per_project_cells 2020-05-20 20:16:22 +02:00
rpc.py Remove unnecessary wrapper 2019-05-29 17:14:13 +01:00
safe_utils.py
service.py Reset the cell cache for database access in Service 2020-04-10 22:31:20 +00:00
service_auth.py
test.py Cache security group driver 2019-12-05 14:02:54 +00:00
utils.py Allow strict_proxies for sdk Connection 2019-08-23 14:14:40 -05:00
version.py
weights.py Per aggregate scheduling weight 2019-01-21 11:48:44 +08:00
wsgi.py