Merge "novaclient: Convert v3 boot command with v2.1 spec (bdm)"
This commit is contained in:
commit
84ccbf3681
@ -337,7 +337,7 @@ class ShellTest(utils.TestCase):
|
|||||||
{'server': {
|
{'server': {
|
||||||
'flavor_ref': '1',
|
'flavor_ref': '1',
|
||||||
'name': 'some-server',
|
'name': 'some-server',
|
||||||
'os-block-device-mapping:block_device_mapping': [
|
'block_device_mapping': [
|
||||||
{
|
{
|
||||||
'volume_id': 'blah',
|
'volume_id': 'blah',
|
||||||
'delete_on_termination': '0',
|
'delete_on_termination': '0',
|
||||||
@ -366,7 +366,7 @@ class ShellTest(utils.TestCase):
|
|||||||
{'server': {
|
{'server': {
|
||||||
'flavor_ref': '1',
|
'flavor_ref': '1',
|
||||||
'name': 'some-server',
|
'name': 'some-server',
|
||||||
'os-block-device-mapping:block_device_mapping': [
|
'block_device_mapping': [
|
||||||
{'device_name': 'id', 'volume_id': id,
|
{'device_name': 'id', 'volume_id': id,
|
||||||
'source_type': 'volume', 'boot_index': 0, 'uuid': id}],
|
'source_type': 'volume', 'boot_index': 0, 'uuid': id}],
|
||||||
'image_ref': '1',
|
'image_ref': '1',
|
||||||
|
@ -437,11 +437,12 @@ class ServerManager(base.BootingManagerWithFind):
|
|||||||
|
|
||||||
# Block device mappings are passed as a list of dictionaries
|
# Block device mappings are passed as a list of dictionaries
|
||||||
if block_device_mapping:
|
if block_device_mapping:
|
||||||
bdm_param = 'os-block-device-mapping:block_device_mapping'
|
bdm_param = 'block_device_mapping'
|
||||||
body['server'][bdm_param] = \
|
body['server'][bdm_param] = \
|
||||||
self._parse_block_device_mapping(block_device_mapping)
|
self._parse_block_device_mapping(block_device_mapping)
|
||||||
elif block_device_mapping_v2:
|
elif block_device_mapping_v2:
|
||||||
# Append the image to the list only if we have new style BDMs
|
# Append the image to the list only if we have new style BDMs
|
||||||
|
bdm_param = 'block_device_mapping_v2'
|
||||||
if image:
|
if image:
|
||||||
bdm_dict = {'uuid': image.id, 'source_type': 'image',
|
bdm_dict = {'uuid': image.id, 'source_type': 'image',
|
||||||
'destination_type': 'local', 'boot_index': 0,
|
'destination_type': 'local', 'boot_index': 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user