@@ -360,17 +360,14 @@ def from_stale_hosted_entities(
360
360
)
361
361
if len (operation_hosts ) == 0 :
362
362
raise NothingToReconfigureError ("No component needs to be reconfigured." )
363
-
364
363
# Sort by hosts to improve readability
365
364
operation_hosts_sorted = sorted (
366
365
operation_hosts , key = lambda x : f"{ x .operation .name } _{ x .host_name } "
367
366
)
368
-
369
- # Sort operations using DAG topological sort.
370
- reconfigure_operations_sorted = Dag (collections ).topological_sort_key (
367
+ # Sort operations using DAG topological sort
368
+ operation_hosts_sorted = Dag (collections ).topological_sort_key (
371
369
operation_hosts_sorted , key = lambda x : x .operation .name
372
370
)
373
-
374
371
# Generate deployment
375
372
deployment = DeploymentModel (
376
373
deployment_type = DeploymentTypeEnum .RECONFIGURE ,
@@ -384,7 +381,7 @@ def from_stale_hosted_entities(
384
381
state = DeploymentStateEnum .PLANNED ,
385
382
)
386
383
operation_order = 1
387
- for operation , host in reconfigure_operations_sorted :
384
+ for operation , host in operation_hosts_sorted :
388
385
deployment .operations .append (
389
386
OperationModel (
390
387
operation = operation .name ,
@@ -406,7 +403,6 @@ def from_stale_hosted_entities(
406
403
state = OperationStateEnum .PLANNED ,
407
404
)
408
405
)
409
-
410
406
operation_order += 1
411
407
return deployment
412
408
0 commit comments