From: Michal Fojtik <[email protected]>

In case the driver method is called from CIMI, the opts[:image_id]
is empty. Lets use the 'image_id' here anyway.

Signed-off-by: Michal fojtik <[email protected]>
---
 server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb 
b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
index 2ddd43a..272f471 100644
--- a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
+++ b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
@@ -214,7 +214,7 @@ module Deltacloud::Drivers::Vsphere
         if opts[:hwp_cpu]
           raise "Invalid CPU value. Must be in integer format" unless 
valid_cpu_value?(opts[:hwp_cpu])
         end
-        vm = find_vm(credentials, opts[:image_id])
+        vm = find_vm(credentials, image_id)
         raise "ERROR: Could not find the image in given datacenter" unless 
vm[:instance]
         # New instance need valid resource pool and datastore to be placed.
         # For this reason, realm_id **needs** to be set.
-- 
1.8.0.2

Reply via email to