Browse Source

Set a default on BlockDeviceMapping delete flag

Enis Afgan 8 years ago
parent
commit
6fb27a8818
1 changed files with 2 additions and 1 deletions
  1. 2 1
      cloudbridge/cloud/providers/aws/services.py

+ 2 - 1
cloudbridge/cloud/providers/aws/services.py

@@ -523,7 +523,8 @@ class AWSInstanceService(BaseInstanceService):
                         raise InvalidConfigurationException(
                         raise InvalidConfigurationException(
                             "The source is none and the destination is a"
                             "The source is none and the destination is a"
                             " volume. Therefore, you must specify a size.")
                             " volume. Therefore, you must specify a size.")
-                ebs_def['DeleteOnTermination'] = device.delete_on_terminate
+                ebs_def['DeleteOnTermination'] = device.delete_on_terminate \
+                    or True
                 if device.size:
                 if device.size:
                     ebs_def['VolumeSize'] = device.size
                     ebs_def['VolumeSize'] = device.size
                 if ebs_def:
                 if ebs_def: