@@ -533,10 +533,9 @@ def prepare_volume_order_object(manager, storage_type, location, size,
533533 # Find the ID for the requested location
534534 try :
535535 location_id = get_location_id (manager , location )
536- except ValueError :
537- raise exceptions .SoftLayerError (
538- "Invalid datacenter name specified. "
539- "Please provide the lower case short name (e.g.: dal09)" )
536+ except ValueError as ex :
537+ message = "Invalid datacenter name specified. Please provide the lower case short name (e.g.: dal09)"
538+ raise exceptions .SoftLayerError (message ) from ex
540539
541540 # Determine the category code to use for the order (and product package)
542541 order_type_is_saas , order_category_code = _get_order_type_and_category (
@@ -676,10 +675,9 @@ def prepare_replicant_order_object(manager, snapshot_schedule, location,
676675 # Find the ID for the requested location
677676 try :
678677 location_id = get_location_id (manager , location )
679- except ValueError :
680- raise exceptions .SoftLayerError (
681- "Invalid datacenter name specified. "
682- "Please provide the lower case short name (e.g.: dal09)" )
678+ except ValueError as ex :
679+ message = "Invalid datacenter name specified. Please provide the lower case short name (e.g.: dal09)"
680+ raise exceptions .SoftLayerError (message ) from ex
683681
684682 # Get sizes and properties needed for the order
685683 volume_size = int (volume ['capacityGb' ])
0 commit comments