states: maas: Retry linux state if no response 31/40631/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 28 Aug 2017 23:21:30 +0000 (01:21 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Tue, 29 Aug 2017 23:25:13 +0000 (01:25 +0200)
JIRA: FUEL-283

Change-Id: Ie85af8c12163fac28cb8826aa8902a4ff3dec623
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
mcp/config/states/maas

index 01f8ee0..710ec0e 100755 (executable)
@@ -102,7 +102,8 @@ done
 
 wait_for 10 "salt -C '* and not cfg01* and not mas01*' saltutil.sync_all"
 wait_for 10 "salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' state.apply salt"
-wait_for 10 "salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' state.apply linux,ntp"
+wait_for 10 "! salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' state.apply linux,ntp | " \
+  "tee /dev/stderr | fgrep -q 'Not connected'"
 
 wait_for 10 "salt -C 'E@^(?!cfg01|mas01|kvm|cmp00).*' ssh.set_auth_key ${SUDO_USER} \
   $(awk 'NR==1{print $2}' $(eval echo ~${SUDO_USER}/.ssh/authorized_keys))"