diff --git a/moto/ec2/models.py b/moto/ec2/models.py index 05650904a..309cab6bf 100644 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -1224,7 +1224,7 @@ class VolumeAttachment(object): class Volume(TaggedEC2Resource): - def __init__(self, volume_id, size, zone): + def __init__(self, ec2_backend, volume_id, size, zone): self.id = volume_id self.size = size self.zone = zone @@ -1254,7 +1254,7 @@ class Volume(TaggedEC2Resource): class Snapshot(TaggedEC2Resource): - def __init__(self, snapshot_id, volume, description): + def __init__(self, ec2_backend, snapshot_id, volume, description): self.id = snapshot_id self.volume = volume self.description = description @@ -1272,7 +1272,7 @@ class EBSBackend(object): def create_volume(self, size, zone_name): volume_id = random_volume_id() zone = self.get_zone_by_name(zone_name) - volume = Volume(volume_id, size, zone) + volume = Volume(self, volume_id, size, zone) self.volumes[volume_id] = volume return volume @@ -1314,7 +1314,7 @@ class EBSBackend(object): def create_snapshot(self, volume_id, description): snapshot_id = random_snapshot_id() volume = self.get_volume(volume_id) - snapshot = Snapshot(snapshot_id, volume, description) + snapshot = Snapshot(self, snapshot_id, volume, description) self.snapshots[snapshot_id] = snapshot return snapshot