Simplify conditional
This commit is contained in:
parent
66db4fffa0
commit
41b1482b59
1 changed files with 1 additions and 1 deletions
|
|
@ -2064,7 +2064,7 @@ class EBSBackend(object):
|
||||||
def delete_volume(self, volume_id):
|
def delete_volume(self, volume_id):
|
||||||
if volume_id in self.volumes:
|
if volume_id in self.volumes:
|
||||||
volume = self.volumes[volume_id]
|
volume = self.volumes[volume_id]
|
||||||
if volume.attachment is not None:
|
if volume.attachment:
|
||||||
raise VolumeInUseError(volume_id, volume.attachment.instance.id)
|
raise VolumeInUseError(volume_id, volume.attachment.instance.id)
|
||||||
return self.volumes.pop(volume_id)
|
return self.volumes.pop(volume_id)
|
||||||
raise InvalidVolumeIdError(volume_id)
|
raise InvalidVolumeIdError(volume_id)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue