fix(windows99): expose autostart check-mode executor
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 3m30s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 3m30s
CD Pipeline / post-deploy-checks (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -3694,6 +3694,38 @@ def _enrich_from_current_readbacks(
|
||||
)
|
||||
is True
|
||||
)
|
||||
state[
|
||||
"windows99_vmware_autostart_check_mode_execute_allowed_by_this_package"
|
||||
] = bool(
|
||||
windows99_vmware_autostart_check_mode_package.get(
|
||||
"check_mode_execute_allowed_by_this_package"
|
||||
)
|
||||
is True
|
||||
)
|
||||
state["windows99_vmware_autostart_check_mode_runtime_write_authorized"] = bool(
|
||||
windows99_vmware_autostart_check_mode_package.get(
|
||||
"check_mode_runtime_write_authorized"
|
||||
)
|
||||
is True
|
||||
)
|
||||
state["windows99_vmware_autostart_check_mode_collector_command"] = str(
|
||||
windows99_vmware_autostart_check_mode_package.get(
|
||||
"check_mode_collector_command"
|
||||
)
|
||||
or ""
|
||||
)
|
||||
state["windows99_vmware_autostart_check_mode_scorecard_command"] = str(
|
||||
windows99_vmware_autostart_check_mode_package.get(
|
||||
"check_mode_scorecard_command"
|
||||
)
|
||||
or ""
|
||||
)
|
||||
state["windows99_vmware_autostart_check_mode_post_verifier_count"] = _int(
|
||||
windows99_vmware_autostart_check_mode_package.get(
|
||||
"check_mode_post_verifier_count"
|
||||
)
|
||||
or state["windows99_vmware_autostart_check_mode_post_apply_verifier_count"]
|
||||
)
|
||||
state["windows99_vmware_autostart_check_mode_collector_readback_present"] = bool(
|
||||
windows99_vmware_autostart_check_mode_package.get(
|
||||
"collector_readback_present"
|
||||
@@ -5414,6 +5446,29 @@ def _set_rollups_and_summary(
|
||||
)
|
||||
is True
|
||||
),
|
||||
"windows99_vmware_autostart_check_mode_execute_allowed_by_this_package": (
|
||||
state.get(
|
||||
"windows99_vmware_autostart_check_mode_execute_allowed_by_this_package"
|
||||
)
|
||||
is True
|
||||
),
|
||||
"windows99_vmware_autostart_check_mode_runtime_write_authorized": (
|
||||
state.get(
|
||||
"windows99_vmware_autostart_check_mode_runtime_write_authorized"
|
||||
)
|
||||
is True
|
||||
),
|
||||
"windows99_vmware_autostart_check_mode_collector_command": str(
|
||||
state.get("windows99_vmware_autostart_check_mode_collector_command")
|
||||
or ""
|
||||
),
|
||||
"windows99_vmware_autostart_check_mode_scorecard_command": str(
|
||||
state.get("windows99_vmware_autostart_check_mode_scorecard_command")
|
||||
or ""
|
||||
),
|
||||
"windows99_vmware_autostart_check_mode_post_verifier_count": _int(
|
||||
state.get("windows99_vmware_autostart_check_mode_post_verifier_count")
|
||||
),
|
||||
"windows99_vmware_autostart_check_mode_collector_readback_present": (
|
||||
state.get(
|
||||
"windows99_vmware_autostart_check_mode_collector_readback_present"
|
||||
@@ -5896,6 +5951,29 @@ def _set_rollups_and_summary(
|
||||
)
|
||||
is True
|
||||
),
|
||||
"windows99_vmware_autostart_check_mode_execute_allowed_by_this_package": (
|
||||
state.get(
|
||||
"windows99_vmware_autostart_check_mode_execute_allowed_by_this_package"
|
||||
)
|
||||
is True
|
||||
),
|
||||
"windows99_vmware_autostart_check_mode_runtime_write_authorized": (
|
||||
state.get(
|
||||
"windows99_vmware_autostart_check_mode_runtime_write_authorized"
|
||||
)
|
||||
is True
|
||||
),
|
||||
"windows99_vmware_autostart_check_mode_collector_command": str(
|
||||
state.get("windows99_vmware_autostart_check_mode_collector_command")
|
||||
or ""
|
||||
),
|
||||
"windows99_vmware_autostart_check_mode_scorecard_command": str(
|
||||
state.get("windows99_vmware_autostart_check_mode_scorecard_command")
|
||||
or ""
|
||||
),
|
||||
"windows99_vmware_autostart_check_mode_post_verifier_count": _int(
|
||||
state.get("windows99_vmware_autostart_check_mode_post_verifier_count")
|
||||
),
|
||||
"windows99_vmware_autostart_check_mode_collector_readback_present": (
|
||||
state.get(
|
||||
"windows99_vmware_autostart_check_mode_collector_readback_present"
|
||||
|
||||
@@ -34,6 +34,8 @@ def _with_ui_counts(
|
||||
scorecard: dict[str, Any],
|
||||
) -> dict[str, Any]:
|
||||
payload = dict(package)
|
||||
action_chain = _dict(payload.get("action_chain"))
|
||||
check_mode = dict(_dict(action_chain.get("check_mode")))
|
||||
powered_off_aliases = _strings(payload.get("powered_off_aliases"))
|
||||
readback = _dict(scorecard.get("readback"))
|
||||
windows99_management = _dict(scorecard.get("windows99_management_channel"))
|
||||
@@ -86,6 +88,43 @@ def _with_ui_counts(
|
||||
or payload["local_console_channel_reachable"]
|
||||
)
|
||||
)
|
||||
check_mode_execute_allowed = bool(
|
||||
payload["effective_check_mode_execution_ready"]
|
||||
and payload.get("apply_allowed_by_this_package") is not True
|
||||
)
|
||||
collector_command = str(
|
||||
check_mode.get("collector_command")
|
||||
or "bash scripts/reboot-recovery/collect-windows99-vmware-verify.sh --collect"
|
||||
)
|
||||
scorecard_command = str(
|
||||
check_mode.get("scorecard_command")
|
||||
or (
|
||||
"python3.11 scripts/reboot-recovery/"
|
||||
"reboot-auto-recovery-slo-scorecard.py --output <scorecard.json>"
|
||||
)
|
||||
)
|
||||
check_mode.update(
|
||||
{
|
||||
"execute_allowed_by_this_package": check_mode_execute_allowed,
|
||||
"execution_ready": payload["effective_check_mode_execution_ready"],
|
||||
"runtime_write_authorized": False,
|
||||
"collector_command": collector_command,
|
||||
"scorecard_command": scorecard_command,
|
||||
}
|
||||
)
|
||||
action_chain["check_mode"] = check_mode
|
||||
payload["action_chain"] = action_chain
|
||||
payload["check_mode_execute_allowed_by_this_package"] = check_mode_execute_allowed
|
||||
payload["check_mode_execution_ready"] = payload[
|
||||
"effective_check_mode_execution_ready"
|
||||
]
|
||||
payload["check_mode_runtime_write_authorized"] = False
|
||||
payload["check_mode_collector_command"] = collector_command
|
||||
payload["check_mode_scorecard_command"] = scorecard_command
|
||||
payload["check_mode_post_verifier"] = _strings(payload.get("post_apply_verifier"))
|
||||
payload["check_mode_post_verifier_count"] = len(
|
||||
payload["check_mode_post_verifier"]
|
||||
)
|
||||
payload["public_display_only"] = True
|
||||
payload["check_mode_package_execution_authorized_by_this_endpoint"] = False
|
||||
return payload
|
||||
|
||||
Reference in New Issue
Block a user