aboutsummaryrefslogtreecommitdiffstats
path: root/patches/opnfv-fuel/0021-states-maas-Retry-linux-state-if-no-response.patch
blob: d7fcb42949a601ede52a65e1daee5bbc2bd34e3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
: Copyright (c) 2017 Enea AB and others.
:
: All rights reserved. This program and the accompanying materials
: are made available under the terms of the Apache License, Version 2.0
: which accompanies this distribution, and is available at
: http://www.apache.org/licenses/LICENSE-2.0
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Date: Tue, 29 Aug 2017 01:21:30 +0200
Subject: [PATCH] states: maas: Retry linux state if no response

Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
 mcp/config/states/maas | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mcp/config/states/maas b/mcp/config/states/maas
index 9e0093b..c54225d 100755
--- a/mcp/config/states/maas
+++ b/mcp/config/states/maas
@@ -104,7 +104,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))"