# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch claudiol-interactive-evmcmd
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	modified:   config.yaml
#	modified:   evmcmd_class.rb
#	modified:   lib/clusters.rb
#	modified:   lib/datastores.rb
#	modified:   lib/hosts.rb
#	modified:   lib/management_systems.rb
#	modified:   lib/resource_pools.rb
#	modified:   lib/virtual_machines.rb
#
modified:   evmcmd_class.rb
   - Just made sure that help worked
modified:   lib/clusters.rb
   - Changed exit to return so that the interactive portion works as well.
modified:   lib/datastores.rb
   - Changed exit to return so that the interactive portion works as well.
modified:   lib/hosts.rb
   - Changed exit to return so that the interactive portion works as well.
modified:   lib/management_systems.rb
   - Changed exit to return so that the interactive portion works as well.
modified:   lib/resource_pools.rb
   - Changed exit to return so that the interactive portion works as well.
modified:   lib/virtual_machines.rb
   - Changed exit to return so that the interactive portion works as well.
   - Made changes to the load method:
      # Protected these items as well... sometimes vm[:host], vm[:parent] and vm[:parent_resource_pool] are nil
      $hostGuid = (vm[:host]) ? vm[:host][:guid] : nil
      $clusterId = (vm[:parent_cluster]) ? vm[:parent_cluster][:id] : nil
      $resourcepoolId = (vm[:parent_resource_pool]) ? vm[:parent_resource_pool][:id] : nil

   - We now check for the following in load method:
     if $hostGuid == nil
     if $clusterId == nil
     if $resourcepoolId == nil

   - Added begin and rescue blocks to printout method
     # The reason we put this in a begin rescue block is to make sure
     # we knew where the error occurred using the err.backtrace
     # which will give us where the error occurred ...
     #
  - With these changes we can get all the VM details even if their parent cluster, host etc do not exist.

  - Both test cases work now. Test cases are:
    VM details used to fail for:
    GUID: 356105ee-a0ae-11e3-920e-00505690455f	 name: wefr45645634634ewfwessseeww

    VM details Ok for:
    GUID: a0ba613c-9a55-11e3-a951-001a4a0f4594	 name: vmtest