diff --git a/openstack/compute/v2/volume_attachment.py b/openstack/compute/v2/volume_attachment.py index 770395c7d..45fc45bc2 100644 --- a/openstack/compute/v2/volume_attachment.py +++ b/openstack/compute/v2/volume_attachment.py @@ -39,5 +39,7 @@ class VolumeAttachment(resource.Resource): attachment_id = resource.Body('attachment_id', alternate_id=True) #: Virtual device tags for the attachment. tag = resource.Body('tag') - # tag introduced in 2.70 - _max_microversion = '2.70' + #: Indicates whether to delete the volume when server is destroyed + delete_on_termination = resource.Body('delete_on_termination') + # delete_on_termination introduced in 2.79 + _max_microversion = '2.79' diff --git a/openstack/tests/unit/compute/v2/test_volume_attachment.py b/openstack/tests/unit/compute/v2/test_volume_attachment.py index 2eb473d4a..03d031c1f 100644 --- a/openstack/tests/unit/compute/v2/test_volume_attachment.py +++ b/openstack/tests/unit/compute/v2/test_volume_attachment.py @@ -19,6 +19,7 @@ EXAMPLE = { 'id': '2', 'volume_id': '3', 'tag': '4', + 'delete_on_termination': 'true', } @@ -46,3 +47,5 @@ class TestServerInterface(base.TestCase): self.assertEqual(EXAMPLE['id'], sot.id) self.assertEqual(EXAMPLE['volume_id'], sot.volume_id) self.assertEqual(EXAMPLE['tag'], sot.tag) + self.assertEqual(EXAMPLE['delete_on_termination'], + sot.delete_on_termination)