def detach_volume(self): volume_id = self.querystring.get('VolumeId')[0] instance_id = self.querystring.get('InstanceId')[0] device_path = self.querystring.get('Device')[0] attachment = ec2_backend.detach_volume(volume_id, instance_id, device_path) template = Template(DETATCH_VOLUME_RESPONSE) return template.render(attachment=attachment)
def detach_volume(self): volume_id = self.querystring.get('VolumeId')[0] instance_id = self.querystring.get('InstanceId')[0] device_path = self.querystring.get('Device')[0] attachment = ec2_backend.detach_volume(volume_id, instance_id, device_path) if not attachment: # Volume wasn't attached return "Volume {0} can not be detached from {1} because it is not attached".format(volume_id, instance_id), dict(status=404) template = Template(DETATCH_VOLUME_RESPONSE) return template.render(attachment=attachment)
def detach_volume(self): volume_id = self.querystring.get('VolumeId')[0] instance_id = self.querystring.get('InstanceId')[0] device_path = self.querystring.get('Device')[0] attachment = ec2_backend.detach_volume(volume_id, instance_id, device_path) if not attachment: # Volume wasn't attached return "Volume {} can not be detached from {} because it is not attached".format( volume_id, instance_id), dict(status=404) template = Template(DETATCH_VOLUME_RESPONSE) return template.render(attachment=attachment)