Fix for Volumes and Snapshots to use correct region.
This commit is contained in:
parent
30305d8986
commit
d734bca6a5
@ -1224,7 +1224,7 @@ class VolumeAttachment(object):
|
|||||||
|
|
||||||
|
|
||||||
class Volume(TaggedEC2Resource):
|
class Volume(TaggedEC2Resource):
|
||||||
def __init__(self, volume_id, size, zone):
|
def __init__(self, ec2_backend, volume_id, size, zone):
|
||||||
self.id = volume_id
|
self.id = volume_id
|
||||||
self.size = size
|
self.size = size
|
||||||
self.zone = zone
|
self.zone = zone
|
||||||
@ -1254,7 +1254,7 @@ class Volume(TaggedEC2Resource):
|
|||||||
|
|
||||||
|
|
||||||
class Snapshot(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.id = snapshot_id
|
||||||
self.volume = volume
|
self.volume = volume
|
||||||
self.description = description
|
self.description = description
|
||||||
@ -1272,7 +1272,7 @@ class EBSBackend(object):
|
|||||||
def create_volume(self, size, zone_name):
|
def create_volume(self, size, zone_name):
|
||||||
volume_id = random_volume_id()
|
volume_id = random_volume_id()
|
||||||
zone = self.get_zone_by_name(zone_name)
|
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
|
self.volumes[volume_id] = volume
|
||||||
return volume
|
return volume
|
||||||
|
|
||||||
@ -1314,7 +1314,7 @@ class EBSBackend(object):
|
|||||||
def create_snapshot(self, volume_id, description):
|
def create_snapshot(self, volume_id, description):
|
||||||
snapshot_id = random_snapshot_id()
|
snapshot_id = random_snapshot_id()
|
||||||
volume = self.get_volume(volume_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
|
self.snapshots[snapshot_id] = snapshot
|
||||||
return snapshot
|
return snapshot
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user