diff --git a/lib/vcloud/core/vm.rb b/lib/vcloud/core/vm.rb index 3a71906..bff6030 100644 --- a/lib/vcloud/core/vm.rb +++ b/lib/vcloud/core/vm.rb @@ -113,9 +113,8 @@ def generate_preamble(script_path, script_post_processor, vars) end def update_storage_profile storage_profile - storage_profile_name = storage_profile[:name] - storage_profile_href = get_storage_profile_href_by_name(storage_profile_name, @vapp.name) - @fog_interface.put_vm(id, name, {:StorageProfile => { name: storage_profile_name, href: storage_profile_href } }) + storage_profile_href = get_storage_profile_href_by_name(storage_profile, @vapp.name) + @fog_interface.put_vm(id, name, {:StorageProfile => { name: storage_profile, href: storage_profile_href } }) end private diff --git a/spec/integration/launcher/data/happy_path.yaml.erb b/spec/integration/launcher/data/happy_path.yaml.erb index 94670d1..d32f703 100644 --- a/spec/integration/launcher/data/happy_path.yaml.erb +++ b/spec/integration/launcher/data/happy_path.yaml.erb @@ -29,5 +29,4 @@ vapps: script_path: <%= bootstrap_script %> vars: message: hello world - storage_profile: - name: <%= storage_profile %> + storage_profile: <%= storage_profile %> diff --git a/spec/integration/launcher/data/storage_profile.yaml.erb b/spec/integration/launcher/data/storage_profile.yaml.erb index f4dfbfb..06d85f3 100644 --- a/spec/integration/launcher/data/storage_profile.yaml.erb +++ b/spec/integration/launcher/data/storage_profile.yaml.erb @@ -12,8 +12,7 @@ vapps: script_path: <%= bootstrap_script %> vars: message: hello world - storage_profile: - name: <%= storage_profile %> + storage_profile: <%= storage_profile %> - name: <%= vapp_name_2 %> vdc_name: <%= vdc_name_2 %> catalog: <%= catalog %> @@ -26,8 +25,7 @@ vapps: script_path: <%= bootstrap_script %> vars: message: hello world - storage_profile: - name: <%= storage_profile %> + storage_profile: <%= storage_profile %> - name: <%= vapp_name_3 %> vdc_name: <%= vdc_name_1 %> catalog: <%= catalog %> @@ -52,5 +50,4 @@ vapps: script_path: <%= bootstrap_script %> vars: message: hello world - storage_profile: - name: <%= nonsense_storage_profile %> + storage_profile: <%= nonsense_storage_profile %> diff --git a/spec/vcloud/core/vm_spec.rb b/spec/vcloud/core/vm_spec.rb index f77ad9b..fcfc9db 100644 --- a/spec/vcloud/core/vm_spec.rb +++ b/spec/vcloud/core/vm_spec.rb @@ -191,9 +191,7 @@ module Core context "update storage profiles" do it "should update the storage profile" do - storage_profile = { - name: 'storage_profile_name', - } + storage_profile = 'storage_profile_name' vdc_results = [ { :vdcName => 'vdc-test-1' } ] @@ -213,9 +211,7 @@ module Core end it "should raise an error if storage profile is not found" do - storage_profile = { - name: 'storage_profile_name', - } + storage_profile = 'storage_profile_name' vdc_results = [ { :vdcName => 'vdc-test-1' } ] @@ -231,9 +227,7 @@ module Core end it "should raise an error if storage profile id is in unexpected format" do - storage_profile = { - name: 'storage_profile_name', - } + storage_profile = 'storage_profile_name' vdc_results = [ { :vdcName => 'vdc-test-1' } ]