diff --git a/tdp/cli/commands/plan/reconfigure.py b/tdp/cli/commands/plan/reconfigure.py index e1378eb4..1605e6ed 100644 --- a/tdp/cli/commands/plan/reconfigure.py +++ b/tdp/cli/commands/plan/reconfigure.py @@ -38,9 +38,7 @@ def reconfigure( with Dao(db_engine, commit_on_exit=True) as dao: deployment = DeploymentModel.from_stale_hosted_entities( collections=collections, - stale_hosted_entity_statuses=dao.get_hosted_entity_statuses( - filter_stale=True - ), + hosted_entity_statuses=dao.get_hosted_entity_statuses(filter_stale=True), rolling_interval=rolling_interval, ) if preview: diff --git a/tdp/core/deployment/deployment_iterator.py b/tdp/core/deployment/deployment_iterator.py index 241bd018..6d415296 100644 --- a/tdp/core/deployment/deployment_iterator.py +++ b/tdp/core/deployment/deployment_iterator.py @@ -103,9 +103,7 @@ def __init__( self._reconfigure_operations = _group_hosts_by_operation( DeploymentModel.from_stale_hosted_entities( collections=self._collections, - stale_hosted_entity_statuses=[ - status for status in cluster_status.values() if status.is_stale - ], + hosted_entity_statuses=list(cluster_status.values()), ) ) except NothingToReconfigureError: diff --git a/tdp/core/models/deployment_model.py b/tdp/core/models/deployment_model.py index 3df00a9d..fdb8c2f2 100644 --- a/tdp/core/models/deployment_model.py +++ b/tdp/core/models/deployment_model.py @@ -329,21 +329,21 @@ def from_operations_hosts_vars( @staticmethod def from_stale_hosted_entities( collections: Collections, - stale_hosted_entity_statuses: list[HostedEntityStatus], + hosted_entity_statuses: list[HostedEntityStatus], rolling_interval: Optional[int] = None, ) -> DeploymentModel: """Generate a deployment plan for stale components. Args: collections: Collections to retrieve the operations from. - stale_hosted_entity_statuses: List of stale hosted entity statuses. + hosted_entity_statuses: List of hosted entity statuses. rolling_interval: Number of seconds to wait between component restart. Raises: NothingToReconfigureError: If no component needs to be reconfigured. """ operation_hosts: set[OperationHostTuple] = set() - for status in stale_hosted_entity_statuses: + for status in hosted_entity_statuses: if status.to_config: operation_hosts.add( OperationHostTuple( diff --git a/test_dag_order/conftest.py b/test_dag_order/conftest.py index 5bcb9313..3163e3e5 100644 --- a/test_dag_order/conftest.py +++ b/test_dag_order/conftest.py @@ -200,7 +200,7 @@ def plan_reconfigure( # return the deployment plan (it is neither persisted in the database nor executed) return DeploymentModel.from_stale_hosted_entities( collections=collections, - stale_hosted_entity_statuses=dao.get_hosted_entity_statuses(filter_stale=True), + hosted_entity_statuses=dao.get_hosted_entity_statuses(filter_stale=True), )