From 816408657d3c45bcd58df7d06269bfcfeb95ce65 Mon Sep 17 00:00:00 2001 From: ATGE Date: Fri, 24 Jan 2020 12:24:51 -0400 Subject: [PATCH] 1211 Fix checking against literal empty string --- SoftLayer/managers/storage_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SoftLayer/managers/storage_utils.py b/SoftLayer/managers/storage_utils.py index 7cce7671b..80ec60368 100644 --- a/SoftLayer/managers/storage_utils.py +++ b/SoftLayer/managers/storage_utils.py @@ -660,14 +660,14 @@ def prepare_replicant_order_object(manager, snapshot_schedule, location, """ # Ensure the primary volume and snapshot space are not set for cancellation if 'billingItem' not in volume\ - or volume['billingItem']['cancellationDate'] != '': + or volume['billingItem'].get('cancellationDate'): raise exceptions.SoftLayerError( 'This volume is set for cancellation; ' 'unable to order replicant volume') for child in volume['billingItem']['activeChildren']: if child['categoryCode'] == 'storage_snapshot_space'\ - and child['cancellationDate'] != '': + and child.get('cancellationDate'): raise exceptions.SoftLayerError( 'The snapshot space for this volume is set for ' 'cancellation; unable to order replicant volume')