EC2 - Verify default block exists before tearing down
This commit is contained in:
parent
5b596c8a78
commit
da1a2118bb
@ -567,6 +567,7 @@ class Instance(TaggedEC2Resource, BotoInstance):
|
||||
self.ec2_backend.attach_volume(volume.id, self.id, "/dev/sda1")
|
||||
|
||||
def teardown_defaults(self):
|
||||
if "/dev/sda1" in self.block_device_mapping:
|
||||
volume_id = self.block_device_mapping["/dev/sda1"].volume_id
|
||||
self.ec2_backend.detach_volume(volume_id, self.id, "/dev/sda1")
|
||||
self.ec2_backend.delete_volume(volume_id)
|
||||
|
Loading…
Reference in New Issue
Block a user