Making delete_on_termination configurable

In the compute.create_test_server method the delete_on_termination
parameter for the block device mapping is hard coded to be True, this
change allows to pass it as keyword argument, if it is not passed we
keep True as default value.

Change-Id: I38fea4c9e0aca0d0c2fb97fd7d323c4e808ae050
This commit is contained in:
Andrea Rosa 2016-07-01 14:22:38 +01:00
parent 6406a4432d
commit c4b0e0091b
1 changed files with 3 additions and 2 deletions

View File

@ -30,7 +30,8 @@ LOG = logging.getLogger(__name__)
def create_test_server(clients, validatable=False, validation_resources=None,
tenant_network=None, wait_until=None,
volume_backed=False, name=None, flavor=None,
image_id=None, **kwargs):
image_id=None, delete_vol_on_termination=True,
**kwargs):
"""Common wrapper utility returning a test server.
This method is a common wrapper returning a test server that can be
@ -106,7 +107,7 @@ def create_test_server(clients, validatable=False, validation_resources=None,
'source_type': 'volume',
'destination_type': 'volume',
'boot_index': 0,
'delete_on_termination': True}]
'delete_on_termination': delete_vol_on_termination}]
kwargs['block_device_mapping_v2'] = bd_map_v2
# Since this is boot from volume an image does not need