Commit a26565ac authored by Stavros Sachtouris's avatar Stavros Sachtouris

Return volume metadata in "create_volume"

The method used to return results in this format:
  {"volume": {"id": ..., "display_name" ..., ...}}
It now returns the results in this form:
  {"id" ..., "display_name" ..., ...}
as it is the case with every other creation command in kamaki library.
parent e3132145
......@@ -17,6 +17,7 @@ Bug fixes
[grnet/kamaki#76]
* Handle SSL unicode bug with grace [grnet/kamaki#67]
* Check server status before changing it [grnet/kamaki#57]
* Fix format of "create_volume" return values
Support
-------
......
......@@ -309,7 +309,7 @@ class CycladesBlockStorageClient(CycladesBlockStorageRestClient):
volume_type=volume_type,
metadata=metadata,
project=project)
return r.json
return r.json['volume']
def reassign_volume(self, volume_id, project):
self.volumes_action_post(volume_id, {"reassign": {"project": project}})
......
......@@ -35,7 +35,7 @@ from mock import patch, call
from unittest import TestCase
from itertools import product
from kamaki.clients import ClientError, cyclades
from kamaki.clients import cyclades
img_ref = "1m4g3-r3f3r3nc3"
vm_name = "my new VM"
......@@ -304,7 +304,7 @@ class CycladesBlockStorageClient(TestCase):
keys = (
'display_description', 'snapshot_id', 'imageRef',
'volume_type', 'metadata', 'project')
FR.json, server_id, display_name = 'ret', 'vid', 'dn'
FR.json, server_id, display_name = dict(volume='ret'), 'vid', 'dn'
for args in product(
('dd', None), ('sn', None), ('ir', None),
('vt', None), ({'mk': 'mv'}, None), ('pid', None)):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment