From 9f082ecb39beaa09132a8be611bb640c579d95d0 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Sat, 17 Feb 2018 18:01:57 +0100 Subject: [MaaS] Override failed testing by default Some nodes fail automatic testing done by MaaS during commissioning, although running the testing suites one more time manually works. For now, just override all 'failed testing' nodes unconditionally. [stable/euphrates cherry-pick additions] Note: Since our salt formulas are pinned to 2017.12 repos, we need to backport one salt-formula-maas patch merged upstream, which adds support for translating status code '22' to 'Failed testing' [1]. JIRA: FUEL-333 [1] https://github.com/salt-formulas/salt-formula-maas/commit/08ffc3ff Change-Id: I13d3ee3d82550524480aa53aa8752ab90aa940cd Signed-off-by: Alexandru Avadanii (cherry picked from commit 81561126307f15d4f65a743ed2431ea8c713a921) --- mcp/config/states/maas | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'mcp/config/states/maas') diff --git a/mcp/config/states/maas b/mcp/config/states/maas index 39f6badef..24249d40d 100755 --- a/mcp/config/states/maas +++ b/mcp/config/states/maas @@ -27,12 +27,19 @@ function maas_fixup() { local fcnodes=$(echo "${statusout}" | \ grep -Pzo 'status: Failed commissioning\n\s+system_id: \K.+\n') + local ftnodes=$(echo "${statusout}" | \ + grep -Pzo 'status: Failed testing\n\s+system_id: \K.+\n') for node_system_id in ${fcnodes}; do salt -C 'mas01*' state.apply maas.machines.delete \ pillar="{'system_id': '${node_system_id}'}" sleep 10 done - if [ -n "${fcnodes}" ]; then + for node_system_id in ${ftnodes}; do + salt -C 'mas01*' state.apply maas.machines.override_failed_testing \ + pillar="{'system_id': '${node_system_id}'}" + sleep 10 + done + if [ -n "${fcnodes}" ] || [ -n "${ftnodes}" ]; then salt -C 'mas01*' state.apply maas.machines return 1 fi -- cgit 1.2.3-korg