Permalink
Browse files

use zone_id to retrieve network and image id

  • Loading branch information...
Dan Bode
Dan Bode committed Nov 26, 2012
1 parent 0f59ffb commit 60f9649a95cae68e6e310d6054995a282b02fce0
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/puppet/provider/cloudstack_instance/default.rb
@@ -39,8 +39,8 @@ def create
end
flavor_id = get_flavor_id(resource[:flavor])
zone_id = get_zone_id(resource[:zone])
- image_id = get_image_id(resource[:image])
- network_id = resource[:network] ? get_network_id(resource[:network]): nil
+ image_id = get_image_id(resource[:image], zone_id)
+ network_id = resource[:network] ? get_network_id(resource[:network], zone_id): nil
Puppet.debug("Bootstrapping instance with:
:display_name => #{resource[:name]},
:image_id => #{image_id},
@@ -90,12 +90,12 @@ def get_flavor_id(name)
end
# this uses the request object and not the connection object...
- def get_image_id(name)
+ def get_image_id(name, zone_id)
get_id_from_request(name, 'template', 'templatefilter' => 'executable')
end
- def get_network_id(name)
- get_id_from_request(name, 'network')
+ def get_network_id(name, zone_id)
+ get_id_from_request(name, 'network', 'zoneid' => zone_id)
end
def get_zone_id(name)

0 comments on commit 60f9649

Please sign in to comment.