From caae6b83529f18a0848bf952f1f83b1e57ed43eb Mon Sep 17 00:00:00 2001 From: d-m-u Date: Thu, 11 Jan 2018 17:01:23 -0500 Subject: [PATCH] Changes get_targets_for_source to use correct params --- .../manageiq/providers/cloud_manager/provision_workflow.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/models/manageiq/providers/cloud_manager/provision_workflow.rb b/app/models/manageiq/providers/cloud_manager/provision_workflow.rb index c28c751d4bd2..0902017dd98a 100644 --- a/app/models/manageiq/providers/cloud_manager/provision_workflow.rb +++ b/app/models/manageiq/providers/cloud_manager/provision_workflow.rb @@ -26,8 +26,8 @@ def allowed_cloud_subnets(_options = {}) end def allowed_cloud_networks(_options = {}) - source = load_ar_obj(get_source_vm) - targets = get_targets_for_source(source, :cloud_filter, CloudNetwork, 'cloud_network_id') + return {} unless (src = provider_or_tenant_object) + targets = get_targets_for_source(src, :cloud_filter, CloudNetwork, 'cloud_networks') allowed_ci(:cloud_network, [:availability_zone], targets.map(&:id)) end @@ -95,7 +95,6 @@ def availability_zone_to_cloud_network(src) hash[cn.id] = cn.name end else - return {} unless load_ar_obj(src[:ems]).cloud_subnets load_ar_obj(src[:ems]).cloud_subnets.collect(&:cloud_network).each_with_object({}) do |cn, hash| hash[cn.id] = cn.name end