2015-03-24 12:07:43 |
Valeriy Ponomaryov |
description |
Manila share types have one required extra spec - "driver_handles_share_servers". And API disallows us to set some additional extra specs if we do not provide this one too. But it is ugly, because if we do not want to update this spec than we should not be
obligated to provide it.
Here is how it looks like:
$ manila --debug type-key somesharetype set k=v
...
REQ: curl -i -X POST http://172.18.198.52:8786/v1/694351ade1624402904c3f763bf9e7ec/types/96f373f2-5bd3-4641-9bff-b5b55d5ad2c7/extra_specs -H "X-Auth-Token: 34988e15e946485cbd600f56cf192463" -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-manilaclient" -d '{"extra_specs": {"k": "v"}}'
RESP: [400] {'date': 'Tue, 24 Mar 2015 12:01:07 GMT', 'connection': 'keep-alive', 'content-type': 'application/json; charset=UTF-8', 'content-length': '131', 'x-compute-request-id': 'req-01f0d48f-f689-4530-8a74-7faeefc078a7'}
RESP BODY: {"badRequest": {"message": "Invalid extra_spec: Required extra specs 'driver_handles_share_servers' not specified..", "code": 400}}
DEBUG (shell:507) Invalid extra_spec: Required extra specs 'driver_handles_share_servers' not specified.. (HTTP 400) (Request-ID: req-01f0d48f-f689-4530-8a74-7faeefc078a7)
Traceback (most recent call last):
File "/opt/stack/python-manilaclient/manilaclient/shell.py", line 502, in main
map(encodeutils.safe_decode, sys.argv[1:]))
File "/opt/stack/python-manilaclient/manilaclient/shell.py", line 450, in main
args.func(self.cs, args)
File "/opt/stack/python-manilaclient/manilaclient/v1/shell.py", line 1903, in do_type_key
stype.set_keys(keypair)
File "/opt/stack/python-manilaclient/manilaclient/v1/share_types.py", line 73, in set_keys
return_raw=True,
File "/opt/stack/python-manilaclient/manilaclient/base.py", line 143, in _create
resp, body = self.api.client.post(url, body=body)
File "/opt/stack/python-manilaclient/manilaclient/httpclient.py", line 131, in post
return self._cs_request(url, 'POST', **kwargs)
File "/opt/stack/python-manilaclient/manilaclient/httpclient.py", line 107, in _cs_request
**kwargs)
File "/opt/stack/python-manilaclient/manilaclient/httpclient.py", line 96, in request
raise exceptions.from_response(resp, method, url)
BadRequest: Invalid extra_spec: Required extra specs 'driver_handles_share_servers' not specified.. (HTTP 400) (Request-ID: req-01f0d48f-f689-4530-8a74-7faeefc078a7)
ERROR: Invalid extra_spec: Required extra specs 'driver_handles_share_servers' not specified.. |
Manila share types have one required extra spec - "driver_handles_share_servers". And API disallows us to set some additional extra specs if we do not provide this one too. But it is ugly, because if we do not want to update this spec then we should not be
obligated to provide it.
Here is how it looks like:
$ manila --debug type-key somesharetype set k=v
...
REQ: curl -i -X POST http://172.18.198.52:8786/v1/694351ade1624402904c3f763bf9e7ec/types/96f373f2-5bd3-4641-9bff-b5b55d5ad2c7/extra_specs -H "X-Auth-Token: 34988e15e946485cbd600f56cf192463" -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-manilaclient" -d '{"extra_specs": {"k": "v"}}'
RESP: [400] {'date': 'Tue, 24 Mar 2015 12:01:07 GMT', 'connection': 'keep-alive', 'content-type': 'application/json; charset=UTF-8', 'content-length': '131', 'x-compute-request-id': 'req-01f0d48f-f689-4530-8a74-7faeefc078a7'}
RESP BODY: {"badRequest": {"message": "Invalid extra_spec: Required extra specs 'driver_handles_share_servers' not specified..", "code": 400}}
DEBUG (shell:507) Invalid extra_spec: Required extra specs 'driver_handles_share_servers' not specified.. (HTTP 400) (Request-ID: req-01f0d48f-f689-4530-8a74-7faeefc078a7)
Traceback (most recent call last):
File "/opt/stack/python-manilaclient/manilaclient/shell.py", line 502, in main
map(encodeutils.safe_decode, sys.argv[1:]))
File "/opt/stack/python-manilaclient/manilaclient/shell.py", line 450, in main
args.func(self.cs, args)
File "/opt/stack/python-manilaclient/manilaclient/v1/shell.py", line 1903, in do_type_key
stype.set_keys(keypair)
File "/opt/stack/python-manilaclient/manilaclient/v1/share_types.py", line 73, in set_keys
return_raw=True,
File "/opt/stack/python-manilaclient/manilaclient/base.py", line 143, in _create
resp, body = self.api.client.post(url, body=body)
File "/opt/stack/python-manilaclient/manilaclient/httpclient.py", line 131, in post
return self._cs_request(url, 'POST', **kwargs)
File "/opt/stack/python-manilaclient/manilaclient/httpclient.py", line 107, in _cs_request
**kwargs)
File "/opt/stack/python-manilaclient/manilaclient/httpclient.py", line 96, in request
raise exceptions.from_response(resp, method, url)
BadRequest: Invalid extra_spec: Required extra specs 'driver_handles_share_servers' not specified.. (HTTP 400) (Request-ID: req-01f0d48f-f689-4530-8a74-7faeefc078a7)
ERROR: Invalid extra_spec: Required extra specs 'driver_handles_share_servers' not specified.. |
|