Skip to content

Commit

Permalink
Merge pull request #9670 from petr-balogh/fix-issue-in-vsphere-destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
petr-balogh authored Apr 12, 2024
2 parents 1e1e70c + f987b93 commit 78d9dc5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions ocs_ci/utility/vsphere.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,8 +785,19 @@ def check_folder_exists(self, name, cluster, dc):

vms = dc.vmFolder.childEntity
for vm in vms:
if vm.name == name:
_rc = True
try:
if vm.name == name:
_rc = True
except vmodl.fault.ManagedObjectNotFound as ex:
logger.exception(
"There was an exception hit while attempting to check if folder exists!"
)
if (
"has already been deleted or has not been completely create"
not in str(ex)
):
raise

return _rc

def destroy_folder(self, name, cluster, dc):
Expand Down

0 comments on commit 78d9dc5

Please sign in to comment.