From d734bca6a57ed18a6070a1a606545b02beba2a74 Mon Sep 17 00:00:00 2001 From: Steve Pulec Date: Sat, 15 Nov 2014 09:17:35 -0500 Subject: [PATCH] Fix for Volumes and Snapshots to use correct region. --- moto/ec2/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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