You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by mf...@redhat.com on 2013/01/02 15:11:15 UTC
[PATCH core 3/4] VSphere: Make the 'name' parameter optional
From: Michal Fojtik <mf...@redhat.com>
In case 'name' is not sent, use the default "inst#{Time.now.to_i}"
name.
Signed-off-by: Michal fojtik <mf...@redhat.com>
---
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 5bc7088..2ddd43a 100644
--- a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
+++ b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
@@ -290,7 +290,7 @@ module Deltacloud::Drivers::Vsphere
:config => RbVmomi::VIM.VirtualMachineConfigSpec(machine_config)
)
instance_profile = InstanceProfile::new('default', :hwp_memory => opts[:hwp_memory], :hwp_cpu => opts[:hwp_cpu])
- task = vm[:instance].CloneVM_Task(:folder => vm[:instance].parent, :name => opts[:name], :spec => spec)
+ task = vm[:instance].CloneVM_Task(:folder => vm[:instance].parent, :name => opts[:name] || "inst#{Time.now.to_i}", :spec => spec)
new_instance = Instance::new(
:id => opts[:name],
:name => opts[:name],
--
1.8.0.2