Merge "novaclient: Convert v3 boot command with v2.1 spec (bdm)"

This commit is contained in:
Jenkins 2014-09-17 01:24:54 +00:00 committed by Gerrit Code Review
commit 84ccbf3681
2 changed files with 4 additions and 3 deletions

View File

@ -337,7 +337,7 @@ class ShellTest(utils.TestCase):
{'server': {
'flavor_ref': '1',
'name': 'some-server',
'os-block-device-mapping:block_device_mapping': [
'block_device_mapping': [
{
'volume_id': 'blah',
'delete_on_termination': '0',
@ -366,7 +366,7 @@ class ShellTest(utils.TestCase):
{'server': {
'flavor_ref': '1',
'name': 'some-server',
'os-block-device-mapping:block_device_mapping': [
'block_device_mapping': [
{'device_name': 'id', 'volume_id': id,
'source_type': 'volume', 'boot_index': 0, 'uuid': id}],
'image_ref': '1',

View File

@ -437,11 +437,12 @@ class ServerManager(base.BootingManagerWithFind):
# Block device mappings are passed as a list of dictionaries
if block_device_mapping:
bdm_param = 'os-block-device-mapping:block_device_mapping'
bdm_param = 'block_device_mapping'
body['server'][bdm_param] = \
self._parse_block_device_mapping(block_device_mapping)
elif block_device_mapping_v2:
# Append the image to the list only if we have new style BDMs
bdm_param = 'block_device_mapping_v2'
if image:
bdm_dict = {'uuid': image.id, 'source_type': 'image',
'destination_type': 'local', 'boot_index': 0,