Skip to content

Commit

Permalink
Merge pull request #223 from tinaafitz/fix_cloud_tenant
Browse files Browse the repository at this point in the history
Fix Service Provisioning cloud_tenant issue
  • Loading branch information
agrare authored Feb 7, 2018
2 parents 8c35f17 + 1137017 commit df2b8df
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ class ManageIQ::Providers::Openstack::CloudManager::Provision < ::MiqProvisionCl
include_concern 'Cloning'
include_concern 'Configuration'
include_concern 'VolumeAttachment'
include_concern 'OptionsHelper'
end
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def find_destination_in_vmdb(ems_ref)
end

def do_clone_task_check(clone_task_ref)
connection_options = {:tenant_name => options[:cloud_tenant][1]} if options[:cloud_tenant].kind_of?(Array)
connection_options = {:tenant_name => cloud_tenant.name}
source.with_provider_connection(connection_options) do |openstack|
instance = if connection_options
openstack.servers.get(clone_task_ref)
Expand Down Expand Up @@ -55,7 +55,7 @@ def log_clone_options(clone_options)
end

def start_clone(clone_options)
connection_options = {:tenant_name => options[:cloud_tenant][1]} if options[:cloud_tenant].kind_of?(Array)
connection_options = {:tenant_name => cloud_tenant.name}
if source.kind_of?(ManageIQ::Providers::Openstack::CloudManager::VolumeTemplate)
# remove the image_ref parameter from the options since it actually refers
# to a volume, and then overwrite the default root volume with the volume
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module ManageIQ::Providers::Openstack::CloudManager::Provision::OptionsHelper
def cloud_tenant
@cloud_tenant ||= CloudTenant.find_by(:id => get_option(:cloud_tenant))
end
end

0 comments on commit df2b8df

Please sign in to comment.