From c4434e2da70d03d31c3190d26f343f797b13b60e Mon Sep 17 00:00:00 2001 From: ting wu Date: Thu, 31 May 2018 04:23:38 +0200 Subject: [PATCH] To extend the existing two wait_for states with support for parametric timeouts, timeout value is taken from reclass pillar data. wait_for_deployed.sls wait_for_ready.sls Signed-off-by: ting wu --- maas/machines/wait_for_deployed.sls | 3 +++ maas/machines/wait_for_ready.sls | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/maas/machines/wait_for_deployed.sls b/maas/machines/wait_for_deployed.sls index ebeedac..c84942b 100644 --- a/maas/machines/wait_for_deployed.sls +++ b/maas/machines/wait_for_deployed.sls @@ -9,5 +9,8 @@ wait_for_machines_deployed: - name: maas.wait_for_machine_status - kwargs: req_status: "Deployed" + {%- if region.timeout is defined and region.timeout.deployed is defined %} + timeout: {{ region.timeout.deployed }} + {%- endif %} - require: - cmd: maas_login_admin diff --git a/maas/machines/wait_for_ready.sls b/maas/machines/wait_for_ready.sls index c5d3c28..9aa55b7 100644 --- a/maas/machines/wait_for_ready.sls +++ b/maas/machines/wait_for_ready.sls @@ -7,5 +7,9 @@ maas_login_admin: wait_for_machines_ready: module.run: - name: maas.wait_for_machine_status + - kwargs: + {%- if region.timeout is defined and region.timeout.ready is defined %} + timeout: {{ region.timeout.ready }} + {%- endif %} - require: - cmd: maas_login_admin