examples/readme-2.rb in rbvmomi-1.1.0 vs examples/readme-2.rb in rbvmomi-1.1.1
- old
+ new
@@ -33,18 +33,18 @@
rootFolder = vim.serviceInstance.content.rootFolder
dc = rootFolder.childEntity.grep(RbVmomi::VIM::Datacenter).find { |x| x.name == opts[:datacenter] } or fail "datacenter not found"
vm = dc.vmFolder.childEntity.grep(RbVmomi::VIM::VirtualMachine).find { |x| x.name == vm_name } or fail "VM not found"
task = vm.PowerOnVM_Task
filter = vim.propertyCollector.CreateFilter(
- spec: {
- propSet: [{ type: 'Task', all: false, pathSet: ['info.state']}],
- objectSet: [{ obj: task }]
+ :spec => {
+ :propSet => [{ :type => 'Task', :all => false, :pathSet => ['info.state']}],
+ :objectSet => [{ :obj => task }]
},
- partialUpdates: false
+ :partialUpdates => false
)
ver = ''
while true
- result = vim.propertyCollector.WaitForUpdates(version: ver)
+ result = vim.propertyCollector.WaitForUpdates(:version => ver)
ver = result.version
break if ['success', 'error'].member? task.info.state
end
filter.DestroyPropertyFilter
raise task.info.error if task.info.state == 'error'