Skip to content

Commit

Permalink
feat: check the hosts in the collections during deployment iteration
Browse files Browse the repository at this point in the history
  • Loading branch information
SteBaum committed Aug 2, 2024
1 parent 321f838 commit 4083892
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tdp/core/deployment/deployment_iterator.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,18 @@ def __next__(

operation_rec.state = OperationStateEnum.RUNNING

if host := self._collections.check_collections_hosts():
message = f"{host} has been removed from the inventory file."
logger.error(message)
operation_rec.logs = message.encode("utf-8")
operation_rec.start_time = operation_rec.end_time = (
datetime.utcnow()
)
operation_rec.state = OperationStateEnum.FAILURE
self.deployment.end_time = datetime.utcnow()
self.deployment.state = DeploymentStateEnum.FAILURE
return operation_rec, None

return operation_rec, partial(self._process_operation_fn, operation_rec)
# StopIteration is a "normal" exception raised when the iteration has stopped
except StopIteration as e:
Expand Down

0 comments on commit 4083892

Please sign in to comment.