deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ronelle Landy <rla...@redhat.com>
Subject Re: [PATCH core] VSphere: Set a random name for the Instance when opts[:name] is not set or empty (DTACLOUD-166)
Date Tue, 17 Jul 2012 16:29:22 GMT
ACK - tested - default name is created if no name is input

----- Original Message -----
> From: mfojtik@redhat.com
> To: dev@deltacloud.apache.org
> Sent: Monday, July 16, 2012 7:58:39 AM
> Subject: [PATCH core] VSphere: Set a random name for the Instance when opts[:name] is
not set or empty (DTACLOUD-166)
> 
> From: Michal Fojtik <mfojtik@redhat.com>
> 
> 
> Signed-off-by: Michal fojtik <mfojtik@redhat.com>
> ---
>  server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
> b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
> index 2e868ca..7fd7ad9 100644
> --- a/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
> +++ b/server/lib/deltacloud/drivers/vsphere/vsphere_driver.rb
> @@ -295,6 +295,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])
> +        opts[:name] = "i-#{Time.now.to_i}" if opts[:name].nil? or
> (!opts[:name].nil? && opts[:name].empty?)
>          task = vm[:instance].CloneVM_Task(:folder =>
>          vm[:instance].parent, :name => opts[:name], :spec => spec)
>          new_instance = Instance::new(
>            :id => opts[:name],
> --
> 1.7.10.2
> 
> 

Mime
View raw message