Advertisement
Guest User

Untitled

a guest
Apr 24th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. Then /^I verify that "(.+)" device is on the "(.+)" datastore on "(.+)" esx host$/ do |device_name, ds_name, esx_host|
  2.  
  3. device_name = $common.substitute(device_name).to_sym
  4. ds_name = $common.substitute(ds_name).to_sym
  5. esx_host = $common.substitute(esx_host).to_sym
  6.  
  7. raise "No esx_host with name #{esx_host}" unless $esx_env.key?(esx_host)
  8. raise "Device not found with #{device_name} name!" unless $esx_env[esx_host].vms.key?(device_name)
  9.  
  10. device = $esx_env[esx_host].vms[device_name]
  11. device_id = device.vm_id
  12.  
  13. real_ds_name = $esx_env[esx_host].get_datastore_name_of_vm(device_name, device_id)
  14. real_ds_name = $common.substitute(real_ds_name).to_sym
  15.  
  16. if real_ds_name == ds_name
  17. puts "Real ds name for #{device_name} is the same as provided."
  18. else
  19. raise "DS name for #{device_name} is #{real_ds_name}. Provided #{ds_name}."
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement