Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenStack virt-v2v-wrapper options hash #18143

Merged
merged 2 commits into from
Nov 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/models/service_template_transformation_plan_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,12 @@ def conversion_options_destination_provider_openstack(cluster, storage)
:host => destination_ems.hostname,
:port => destination_ems.port,
:path => '/' + destination_ems.api_version
),
).to_s,
:os_identity_api_version => '3',
:os_user_domain_name => destination_ems.uid_ems,
:os_username => destination_ems.authentication_userid,
:os_password => destination_ems.authentication_password,
:os_project_name => cluster.name
:os_project_name => conversion_host.resource.cloud_tenant.name
},
:osp_server_id => conversion_host.ems_ref,
:osp_destination_project_id => cluster.ems_ref,
Expand Down
10 changes: 6 additions & 4 deletions spec/models/service_template_transformation_plan_task_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,13 @@

context 'destination is openstack' do
let(:dst_ems) { FactoryGirl.create(:ems_openstack, :api_version => 'v3', :zone => FactoryGirl.create(:zone)) }
let(:dst_cloud_tenant) { FactoryGirl.create(:cloud_tenant, :ext_management_system => dst_ems) }
let(:dst_cloud_tenant) { FactoryGirl.create(:cloud_tenant, :name => 'fake tenant', :ext_management_system => dst_ems) }
let(:dst_cloud_volume_type) { FactoryGirl.create(:cloud_volume_type) }
let(:dst_cloud_network_1) { FactoryGirl.create(:cloud_network) }
let(:dst_cloud_network_2) { FactoryGirl.create(:cloud_network) }
let(:conversion_host_vm) { FactoryGirl.create(:vm, :ext_management_system => dst_ems) }
let(:dst_flavor) { FactoryGirl.create(:flavor) }
let(:dst_security_group) { FactoryGirl.create(:security_group) }
let(:conversion_host_vm) { FactoryGirl.create(:vm_openstack, :ext_management_system => dst_ems, :cloud_tenant => dst_cloud_tenant) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we assign a name to this :cloud_tenant and have an expect statement to match it against the os_project_name? My thought is that: If this had been there, we would have detected this bug early on.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

let(:conversion_host) { FactoryGirl.create(:conversion_host, :resource => conversion_host_vm) }

let(:mapping) do
Expand Down Expand Up @@ -563,7 +565,7 @@
:host => dst_ems.hostname,
:port => dst_ems.port,
:path => '/v3'
),
).to_s,
:os_identity_api_version => '3',
:os_user_domain_name => dst_ems.uid_ems,
:os_username => dst_ems.authentication_userid,
Expand Down Expand Up @@ -597,7 +599,7 @@
:host => dst_ems.hostname,
:port => dst_ems.port,
:path => '/v3'
),
).to_s,
:os_identity_api_version => '3',
:os_user_domain_name => dst_ems.uid_ems,
:os_username => dst_ems.authentication_userid,
Expand Down