lib/cf/cli/service/create.rb in cf-3.0.0rc1 vs lib/cf/cli/service/create.rb in cf-3.0.0rc2

- old
+ new

@@ -42,23 +42,26 @@ else !s.service_plans.include? plan end end end + finalize selected_offerings = offerings.any? ? Array(input[:offering, offerings.sort_by(&:label)]) : [] + finalize if selected_offerings.empty? fail "Cannot find services matching the given criteria." end offering = selected_offerings.first service = client.service_instance service.name = input[:name, offering] - + finalize plan = input[:plan, offering.service_plans] + finalize service.service_plan = if plan.is_a?(String) offering.service_plans.find { |p| p.name.casecmp(plan) == 0 } else plan end @@ -66,13 +69,15 @@ with_progress("Creating service #{c(service.name, :name)}") do service.create! end - if app = input[:app] + app = input[:app] + finalize + + if app invoke :bind_service, :service => service, :app => app end - service end private