inconsistency between trove api schema and code for edit() request
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack DBaaS (Trove) |
Fix Released
|
High
|
Amrith Kumar |
Bug Description
The apischema indicate that the edit() request has a structure of:
294 "edit": {
295 "name": "instance:edit",
296 "type": "object",
297 "required": ["instance"],
298 "properties": {
299 "instance": {
300 "type": "object",
301 "required": [],
302 "properties": {
303 "slave_of": {},
304 "name": non_empty_string,
305 "configuration_id": configuration_id,
306 }
307 }
308 }
309 },
The code however uses "configuration" and not "configuration_id". However, since no properties are required and additional properties are allowed, the client gets away by specifying "configuration" and the API service looks for that.
296 def edit(self, req, id, body, tenant_id):
297 """
298 Updates the instance to set or unset one or more attributes.
299 """
300 LOG.info(
301 LOG.debug("req: %s", strutils.
302 LOG.debug("body: %s", strutils.
303 context = req.environ[
304
305 instance = models.
306
307 args = {}
308 args['detach_
309 if 'name' in body['instance']:
310 args['name'] = body['instance'
311 if 'configuration' in body['instance']:
312 args['configura
313 self._modify_
314 return wsgi.Result(None, 202)
DEBUG (session:195) REQ: curl -g -i --cacert "/opt/stack/
If I forced validation of the schema
diff --git a/trove/
index ae6f4c1..63e128c 100644
--- a/trove/
+++ b/trove/
@@ -299,6 +299,7 @@ instance = {
+ "additionalProp
and re-ran the trove update command, it fails!
ubuntu@
ERROR: Validation error: instance Additional properties are not allowed (u'configuration' was unexpected) (HTTP 400)
Changed in trove: | |
assignee: | nobody → Amrith (amrith) |
importance: | Undecided → Medium |
description: | updated |
Changed in trove: | |
milestone: | none → liberty-1 |
Changed in trove: | |
status: | Fix Committed → Fix Released |
Changed in trove: | |
milestone: | liberty-1 → 4.0.0 |
I upp'ed this to High because the parameter "configuration" that we use is not part of the schema and therefore most of the tests (which exercise the validator) fail. That's because the API is also used to unassign a configuration from an instance but the schema doesn't quite allow that ;(