@@ -255,9 +255,8 @@ def create_user_provided(message)
255255 def create_managed ( message , space :)
256256 service_plan = ServicePlan . first ( guid : message . service_plan_guid )
257257 unprocessable_service_plan! unless service_plan_valid? ( service_plan )
258- unavailable_service_plan! ( service_plan . name , service_plan . guid ) unless service_plan_active? ( service_plan )
259- service_plan_not_visible_in_space! ( service_plan . name , service_plan . guid , space . name , space . guid ) \
260- unless service_plan_exists_in_space? ( service_plan , space )
258+ unavailable_service_plan! ( service_plan ) unless service_plan_active? ( service_plan )
259+ service_plan_not_visible_in_space! ( service_plan , space ) unless service_plan_exists_in_space? ( service_plan , space )
261260
262261 action = V3 ::ServiceInstanceCreateManaged . new ( user_audit_info , message . audit_hash )
263262 VCAP ::CloudController ::ManagedServiceInstance . db . transaction do
@@ -415,9 +414,8 @@ def raise_if_invalid_service_plan!(service_instance, message)
415414
416415 service_plan = ServicePlan . first ( guid : message . service_plan_guid )
417416 unprocessable_service_plan! unless service_plan_valid? ( service_plan )
418- unavailable_service_plan! ( service_plan . name , service_plan . guid ) unless service_plan_active? ( service_plan )
419- service_plan_not_visible_in_space! ( service_plan . name , service_plan . guid , space . name , space . guid ) \
420- unless service_plan_exists_in_space? ( service_plan , service_instance . space )
417+ unavailable_service_plan! ( service_plan ) unless service_plan_active? ( service_plan )
418+ service_plan_not_visible_in_space! ( service_plan , space ) unless service_plan_exists_in_space? ( service_plan , service_instance . space )
421419 invalid_service_plan_relation! unless service_plan . service == service_instance . service
422420 end
423421
@@ -437,14 +435,16 @@ def unprocessable_service_plan!
437435 unprocessable! ( 'Invalid service plan. Ensure that the service plan exists, is available, and you have access to it.' )
438436 end
439437
440- def unavailable_service_plan! ( service_plan , service_plan_guid )
441- unprocessable! ( "Invalid service plan. The service plan '#{ service_plan } ' with guid '#{ service_plan_guid } ' has been removed from the service broker's catalog." \
438+ def unavailable_service_plan! ( service_plan )
439+ unprocessable! ( "Invalid service plan. The service plan '#{ service_plan . name } ' with guid '#{ service_plan . guid } ' has been removed from the service broker's catalog. " \
442440 'It is not possible to create new service instances using this plan.' )
443441 end
444442
445- def service_plan_not_visible_in_space! ( service_plan , service_plan_guid , space_name , space_guid )
446- unprocessable! ( "Invalid service plan. Ensure that the service plan '#{ service_plan } ' with guid '#{ service_plan_guid } ' \
447- is visible in your current space '#{ space_name } ' with guid '#{ space_guid } '.")
443+ def service_plan_not_visible_in_space! ( service_plan , space )
444+ unprocessable! ( 'Invalid service plan. This could be due to a space-scoped broker which is offering the service plan ' \
445+ "'#{ service_plan . name } ' with guid '#{ service_plan . guid } in another space or that the plan " \
446+ 'is not enabled in this organization. Ensure that the service plan is visible in your current space ' \
447+ "'#{ space . name } ' with guid '#{ space . guid } '." )
448448 end
449449
450450 def invalid_service_plan_relation!
0 commit comments