Skip to content

Commit e2cd971

Browse files
Jenkinsopenstack-gerrit
authored andcommitted
Merge "Fix block-device-mapping when volume_size is empty"
2 parents 6251d7d + 61cde9c commit e2cd971

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

openstackclient/compute/v2/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ def take_action(self, parsed_args):
544544
else:
545545
mapping['source_type'] = 'volume'
546546
mapping['destination_type'] = 'volume'
547-
if len(dev_map) > 2:
547+
if len(dev_map) > 2 and dev_map[2]:
548548
mapping['volume_size'] = dev_map[2]
549549
if len(dev_map) > 3:
550550
mapping['delete_on_termination'] = dev_map[3]

openstackclient/tests/unit/compute/v2/test_server.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -817,8 +817,7 @@ def test_server_create_with_block_device_mapping(self):
817817
'uuid': real_volume_mapping.split(':', 1)[0],
818818
'destination_type': 'volume',
819819
'source_type': 'volume',
820-
'delete_on_termination': '0',
821-
'volume_size': ''
820+
'delete_on_termination': '0'
822821
}],
823822
nics=[],
824823
scheduler_hints={},
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fixes:
3+
- |
4+
Fix creating a server with a block-device-mapping when volume_size
5+
is empty.
6+
[Bug `1677236 <https://bugs.launchpad.net/bugs/1652827>`_]

0 commit comments

Comments
 (0)