encrypted attribute now respected in create_volume
This commit is contained in:
parent
957678d33d
commit
f9f0d4b7d9
@ -1645,14 +1645,14 @@ class EBSBackend(object):
|
|||||||
self.snapshots = {}
|
self.snapshots = {}
|
||||||
super(EBSBackend, self).__init__()
|
super(EBSBackend, self).__init__()
|
||||||
|
|
||||||
def create_volume(self, size, zone_name, snapshot_id=None):
|
def create_volume(self, size, zone_name, snapshot_id=None, encrypted=False):
|
||||||
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)
|
||||||
if snapshot_id:
|
if snapshot_id:
|
||||||
snapshot = self.get_snapshot(snapshot_id)
|
snapshot = self.get_snapshot(snapshot_id)
|
||||||
if size is None:
|
if size is None:
|
||||||
size = snapshot.volume.size
|
size = snapshot.volume.size
|
||||||
volume = Volume(self, volume_id, size, zone, snapshot_id)
|
volume = Volume(self, volume_id, size, zone, snapshot_id, encrypted)
|
||||||
self.volumes[volume_id] = volume
|
self.volumes[volume_id] = volume
|
||||||
return volume
|
return volume
|
||||||
|
|
||||||
|
@ -29,7 +29,8 @@ class ElasticBlockStore(BaseResponse):
|
|||||||
size = self._get_param('Size')
|
size = self._get_param('Size')
|
||||||
zone = self._get_param('AvailabilityZone')
|
zone = self._get_param('AvailabilityZone')
|
||||||
snapshot_id = self._get_param('SnapshotId')
|
snapshot_id = self._get_param('SnapshotId')
|
||||||
volume = self.ec2_backend.create_volume(size, zone, snapshot_id)
|
encrypted = self._get_param('Encrypted')
|
||||||
|
volume = self.ec2_backend.create_volume(size, zone, snapshot_id, encrypted)
|
||||||
template = self.response_template(CREATE_VOLUME_RESPONSE)
|
template = self.response_template(CREATE_VOLUME_RESPONSE)
|
||||||
return template.render(volume=volume)
|
return template.render(volume=volume)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user