Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

Commit

Permalink
Catch TimeOutError in cleanup_on_provider and log it
Browse files Browse the repository at this point in the history
  • Loading branch information
prichard77 committed Aug 18, 2020
1 parent 7b27c29 commit 08ac103
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cfme/common/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
from cfme.utils.rest import assert_response
from cfme.utils.update import Updateable
from cfme.utils.virtual_machines import deploy_template
from cfme.utils.wait import TimedOutError
from cfme.utils.wait import wait_for


Expand Down Expand Up @@ -989,10 +990,13 @@ def cleanup_on_provider(self, handle_cleanup_exception=True):
Helper method to avoid NotFoundError's during test case tear down.
"""
if self.exists_on_provider:
wait_for(self.mgmt.cleanup, handle_exception=handle_cleanup_exception,
try:
wait_for(self.mgmt.cleanup, handle_exception=handle_cleanup_exception,
timeout=300)
except TimedOutError:
logger.exception(f'cleanup_on_provider: entity {self.name} timed out.')
else:
logger.debug('cleanup_on_provider: entity "%s" does not exist', self.name)
logger.debug(f'cleanup_on_provider: entity {self.name} does not exist')

def equal_drift_results(self, drift_section, section, *indexes):
"""Compares drift analysis results of a row specified by it's title text.
Expand Down

0 comments on commit 08ac103

Please sign in to comment.