Skip to content
This repository has been archived by the owner on Nov 23, 2020. It is now read-only.

Commit

Permalink
No longer require a hash for storage profile
Browse files Browse the repository at this point in the history
Since we no longer need to provide the href to add a storage profile, we do not need the data to be a hash.

Previously, it was:

    storage_profile:
      name: name
      href: href

Now it can be:

    storage_profile: name
  • Loading branch information
annashipman committed Jan 3, 2014
1 parent b19be9a commit d7a69e3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 20 deletions.
5 changes: 2 additions & 3 deletions lib/vcloud/core/vm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions spec/integration/launcher/data/happy_path.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,4 @@ vapps:
script_path: <%= bootstrap_script %>
vars:
message: hello world
storage_profile:
name: <%= storage_profile %>
storage_profile: <%= storage_profile %>
9 changes: 3 additions & 6 deletions spec/integration/launcher/data/storage_profile.yaml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand All @@ -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 %>
Expand All @@ -52,5 +50,4 @@ vapps:
script_path: <%= bootstrap_script %>
vars:
message: hello world
storage_profile:
name: <%= nonsense_storage_profile %>
storage_profile: <%= nonsense_storage_profile %>
12 changes: 3 additions & 9 deletions spec/vcloud/core/vm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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' }
]
Expand All @@ -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' }
]
Expand All @@ -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' }
]
Expand Down

0 comments on commit d7a69e3

Please sign in to comment.