Skip to content

Commit

Permalink
fail if datacenter/datastore could not be found
Browse files Browse the repository at this point in the history
This is based on some manual testing and
https://github.com/ManageIQ/rbvmomi2?tab=readme-ov-file#usage.
previously we ignored this failure case which results in a nilclass
exception somewhere else.
  • Loading branch information
bastelfreak committed Apr 30, 2024
1 parent 9ee1e20 commit 09d0b4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/beaker/hypervisor/vsphere_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def find_vms(names, connection = @connection)
end

def find_datastore(dc, datastorename)
datacenter = @connection.serviceInstance.find_datacenter(dc)
datacenter.find_datastore(datastorename)
datacenter = @connection.serviceInstance.find_datacenter(dc) || raise("datacenter #{dc} not found")
datacenter.find_datastore(datastorename) || raise("datastore #{datastorename} not found")
end

def find_folder(dc, foldername)
Expand Down

0 comments on commit 09d0b4d

Please sign in to comment.