Change in vdsm[master]: schema: make ConnectionRefArgs definition agree with the cod...

zhshzhou at linux.vnet.ibm.com zhshzhou at linux.vnet.ibm.com
Mon Sep 17 09:48:16 UTC 2012


Zhou Zheng Sheng has uploaded a new change for review.

Change subject: schema: make ConnectionRefArgs definition agree with the code
......................................................................

schema: make ConnectionRefArgs definition agree with the code

This argument is one of the nested member for argument of
ConnectionRefs.acquire. It is forward to and unpacked in
hsm.storageServer_ConnectionRefs_acquire. The unpacked value is assigned
to the conInfo variable, then sent to storageServer.dict2conInfo.
In storageServer.dict2conInfo, it uses 'type' to look for the connection
type, but in json schema, it is written as 'connType'.

To test this patch, one can acquire a StorageConnectionRef by providing
a connection info as follow
{'53acd629-47e6-42d8-ba99-cd0b12ff0e1e': {'type': 'localfs', 'params':
	{'path': '/tmp/teststorage'}}}
However if we change 'type' to 'connType' in the above parameter, you
will get an error code 453 under the "results" key of the returned
dictionary. This is because when storageServer.dict2conInfo looks for the
key 'type', but 'connType' is provided, then an KeyError is raised, then
catched in hsm.storageServer_ConnectionRefs_acquire, then it just give a
StorageServerValidationError.code as the error code and do not care
which exception it was. This is where the 453 comes from.

This patch change the 'connType' in json schema to be consistent with
the actual key 'type' used in the code.

Change-Id: Ifb209b577c6736b3b50cf400996b0999a60a8776
Signed-off-by: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
---
M vdsm_api/vdsmapi-schema.json
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/20/8020/1

diff --git a/vdsm_api/vdsmapi-schema.json b/vdsm_api/vdsmapi-schema.json
index a773177..a582e4c 100644
--- a/vdsm_api/vdsmapi-schema.json
+++ b/vdsm_api/vdsmapi-schema.json
@@ -2598,7 +2598,7 @@
 # Since: 4.10.0
 ##
 {'type': 'ConnectionRefArgs',
- 'data': {'connType': 'ConnectionRefType', 'params': 'ConnectionRefParameters'}}
+ 'data': {'type': 'ConnectionRefType', 'params': 'ConnectionRefParameters'}}
 
 ##
 # @ConnectionError:


--
To view, visit http://gerrit.ovirt.org/8020
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb209b577c6736b3b50cf400996b0999a60a8776
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>


More information about the vdsm-patches mailing list