Skip to content

Commit efe2d08

Browse files
Merge pull request #1216 from ATGE/issue1211
1211 REST Issues: file replica-order fails
2 parents 323ed2e + 8164086 commit efe2d08

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

SoftLayer/managers/storage_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,14 +660,14 @@ def prepare_replicant_order_object(manager, snapshot_schedule, location,
660660
"""
661661
# Ensure the primary volume and snapshot space are not set for cancellation
662662
if 'billingItem' not in volume\
663-
or volume['billingItem']['cancellationDate'] != '':
663+
or volume['billingItem'].get('cancellationDate'):
664664
raise exceptions.SoftLayerError(
665665
'This volume is set for cancellation; '
666666
'unable to order replicant volume')
667667

668668
for child in volume['billingItem']['activeChildren']:
669669
if child['categoryCode'] == 'storage_snapshot_space'\
670-
and child['cancellationDate'] != '':
670+
and child.get('cancellationDate'):
671671
raise exceptions.SoftLayerError(
672672
'The snapshot space for this volume is set for '
673673
'cancellation; unable to order replicant volume')

0 commit comments

Comments
 (0)