Fix block-device-mapping when volume_size is empty
The Nova API responds with an validation error when a bdm is submitted containing an empty volume_size. So instead omit that attribute when it is empty. Change-Id: Iba905fca8c440a03e828c20922f3b813bba3fa3a Closes-Bug: 1677236
This commit is contained in:
parent
ca06a09d4d
commit
61cde9c8e8
@ -544,7 +544,7 @@ class CreateServer(command.ShowOne):
|
||||
else:
|
||||
mapping['source_type'] = 'volume'
|
||||
mapping['destination_type'] = 'volume'
|
||||
if len(dev_map) > 2:
|
||||
if len(dev_map) > 2 and dev_map[2]:
|
||||
mapping['volume_size'] = dev_map[2]
|
||||
if len(dev_map) > 3:
|
||||
mapping['delete_on_termination'] = dev_map[3]
|
||||
|
@ -817,8 +817,7 @@ class TestServerCreate(TestServer):
|
||||
'uuid': real_volume_mapping.split(':', 1)[0],
|
||||
'destination_type': 'volume',
|
||||
'source_type': 'volume',
|
||||
'delete_on_termination': '0',
|
||||
'volume_size': ''
|
||||
'delete_on_termination': '0'
|
||||
}],
|
||||
nics=[],
|
||||
scheduler_hints={},
|
||||
|
6
releasenotes/notes/bug-1677236-7de9d11c3f0fb5ed.yaml
Normal file
6
releasenotes/notes/bug-1677236-7de9d11c3f0fb5ed.yaml
Normal file
@ -0,0 +1,6 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fix creating a server with a block-device-mapping when volume_size
|
||||
is empty.
|
||||
[Bug `1677236 <https://bugs.launchpad.net/bugs/1652827>`_]
|
Loading…
Reference in New Issue
Block a user