Просмотр исходного кода

Set a default on BlockDeviceMapping delete flag

Enis Afgan 8 лет назад
Родитель
Сommit
6fb27a8818
1 измененных файлов с 2 добавлено и 1 удалено
  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(
                             "The source is none and the destination is a"
                             " 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:
                     ebs_def['VolumeSize'] = device.size
                 if ebs_def: