Fix for Volumes and Snapshots to use correct region.

This commit is contained in:
Steve Pulec 2014-11-15 09:17:35 -05:00
parent 30305d8986
commit d734bca6a5

View File

@ -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