Skip to content

Commit c05f4a0

Browse files
Merge pull request #982 from FernandoOjeda/fo_cancel_block_storage
Fixed cancel block storage issue
2 parents 32a6e43 + 64fe8b0 commit c05f4a0

File tree

2 files changed

+246
-203
lines changed

2 files changed

+246
-203
lines changed

SoftLayer/managers/block.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,10 @@ def cancel_block_volume(self, volume_id,
510510
block_volume = self.get_block_volume_details(
511511
volume_id,
512512
mask='mask[id,billingItem[id,hourlyFlag]]')
513+
514+
if 'billingItem' not in block_volume:
515+
raise exceptions.SoftLayerError("Block Storage was already cancelled")
516+
513517
billing_item_id = block_volume['billingItem']['id']
514518

515519
if utils.lookup(block_volume, 'billingItem', 'hourlyFlag'):

0 commit comments

Comments
 (0)