From 246c91fc67ea7bb3403f833cb56dd2093c5fcf00 Mon Sep 17 00:00:00 2001 From: Jeff McCune Date: Thu, 19 Jan 2012 11:42:39 -0800 Subject: [PATCH] (maint) Whitespace and format only clean up Without this patch there are some niggling whitespace and formatting issues introduced by this pull request and change set. This patch cleans those up and makes git log --check look nice again. --- lib/fog/vsphere/requests/compute/vm_clone.rb | 20 ++++++++++--------- .../requests/compute/vm_clone_tests.rb | 3 +-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/lib/fog/vsphere/requests/compute/vm_clone.rb b/lib/fog/vsphere/requests/compute/vm_clone.rb index fe7acf59c..bd75147e5 100644 --- a/lib/fog/vsphere/requests/compute/vm_clone.rb +++ b/lib/fog/vsphere/requests/compute/vm_clone.rb @@ -80,13 +80,15 @@ module Fog # this chunk of code reconfigures the disk of the clone source to be read only, # and then creates a delta disk on top of that, this is required by the API in order to create # linked clondes - disks=vm_mob_ref.config.hardware.device.select{|vm_device| vm_device.class == RbVmomi::VIM::VirtualDisk} + disks = vm_mob_ref.config.hardware.device.select do |vm_device| + vm_device.class == RbVmomi::VIM::VirtualDisk + end disks.select{|vm_device| vm_device.backing.parent == nil}.each do |disk| - disk_spec = { - :deviceChange => [ + disk_spec = { + :deviceChange => [ { - :operation => :remove, - :device => disk + :operation => :remove, + :device => disk }, { :operation => :add, @@ -97,14 +99,14 @@ module Fog disk_backing.backing.parent = disk.backing } }, - ] + ] } vm_mob_ref.ReconfigVM_Task(:spec => disk_spec).wait_for_completion end # Next, create a Relocation Spec instance relocation_spec = RbVmomi::VIM.VirtualMachineRelocateSpec(:pool => resource_pool, - :diskMoveType => :moveChildMostDiskBacking) - else + :diskMoveType => :moveChildMostDiskBacking) + else relocation_spec = RbVmomi::VIM.VirtualMachineRelocateSpec(:pool => resource_pool, :transform => options['transform'] || 'sparse') end @@ -159,7 +161,7 @@ module Fog end { 'vm_ref' => 'vm-123', - 'task_ref' => 'task-1234' + 'task_ref' => 'task-1234', } end diff --git a/tests/vsphere/requests/compute/vm_clone_tests.rb b/tests/vsphere/requests/compute/vm_clone_tests.rb index 2e4fe470a..14b3fcb94 100644 --- a/tests/vsphere/requests/compute/vm_clone_tests.rb +++ b/tests/vsphere/requests/compute/vm_clone_tests.rb @@ -1,6 +1,5 @@ Shindo.tests("Fog::Compute[:vsphere] | vm_clone request", 'vsphere') do - #require 'guid' - + # require 'guid' compute = Fog::Compute[:vsphere] response = nil response_linked = nil