diff --git a/moto/ec2/models.py b/moto/ec2/models.py index 37769916..05650904 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -383,10 +383,6 @@ class Instance(BotoInstance, TaggedEC2Resource): self._reason = "" self._state_reason = StateReason() - def get_tags(self): - tags = self.ec2_backend.describe_tags(filters={'resource-id': [self.id]}) - return tags - @property def dynamic_group_list(self): if self.nics: @@ -1227,12 +1223,13 @@ class VolumeAttachment(object): return attachment -class Volume(object): +class Volume(TaggedEC2Resource): def __init__(self, volume_id, size, zone): self.id = volume_id self.size = size self.zone = zone self.attachment = None + self.ec2_backend = ec2_backend @classmethod def create_from_cloudformation_json(cls, resource_name, cloudformation_json): @@ -1256,12 +1253,13 @@ class Volume(object): return 'available' -class Snapshot(object): +class Snapshot(TaggedEC2Resource): def __init__(self, snapshot_id, volume, description): self.id = snapshot_id self.volume = volume self.description = description self.create_volume_permission_groups = set() + self.ec2_backend = ec2_backend class EBSBackend(object): diff --git a/moto/ec2/responses/elastic_block_store.py b/moto/ec2/responses/elastic_block_store.py index 868cf221..69a4cb9e 100644 --- a/moto/ec2/responses/elastic_block_store.py +++ b/moto/ec2/responses/elastic_block_store.py @@ -132,6 +132,16 @@ DESCRIBE_VOLUMES_RESPONSE = """