Skip to content
Snippets Groups Projects

Update validate workflow WF_USABLE_MAP

Merged Karel van Klink requested to merge feature/validate-provisioning-routers into develop
22 files
+ 171
235
Compare changes
  • Side-by-side
  • Inline
Files
22
@@ -2,7 +2,7 @@
import structlog
from orchestrator.services.processes import get_execution_context
from orchestrator.services.subscriptions import TARGET_DEFAULT_USABLE_MAP, WF_USABLE_MAP
from orchestrator.services.subscriptions import TARGET_DEFAULT_USABLE_MAP
from orchestrator.targets import Target
from gso.schedules.scheduling import CronScheduleConfig, scheduler
@@ -29,8 +29,10 @@ def validate_subscriptions() -> None:
validation_workflow = workflow.name
if validation_workflow:
default = TARGET_DEFAULT_USABLE_MAP[Target.SYSTEM]
usable_when = WF_USABLE_MAP.get(validation_workflow, default)
# Validation workflows only run on subscriptions that are active, even when they could be run on
# provisioning subscriptions. E.g. for routers, they can manually be validated when provisioning, but are
# not included in this schedule.
usable_when = TARGET_DEFAULT_USABLE_MAP[Target.SYSTEM]
if subscription.status in usable_when:
json = [{"subscription_id": str(subscription.subscription_id)}]
Loading