forked from ungleich-public/cdist
		
	in theory finish new error catching + displaying code
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								da1d3fbc04
							
						
					
				
			
			
				commit
				
					
						0122ccc3ee
					
				
			
		
					 1 changed files with 10 additions and 6 deletions
				
			
		| 
						 | 
					@ -39,7 +39,7 @@ fi
 | 
				
			||||||
i=0
 | 
					i=0
 | 
				
			||||||
while [ $# -ge 1 ]; do
 | 
					while [ $# -ge 1 ]; do
 | 
				
			||||||
   if [ "$parallel" ]; then
 | 
					   if [ "$parallel" ]; then
 | 
				
			||||||
      cdist-deploy-to "$1" | filter
 | 
					      cdist-deploy-to "$1" | filter &
 | 
				
			||||||
      # Record pid and host for use later
 | 
					      # Record pid and host for use later
 | 
				
			||||||
      eval pid_$i=$!
 | 
					      eval pid_$i=$!
 | 
				
			||||||
      eval host_$i=\$1
 | 
					      eval host_$i=\$1
 | 
				
			||||||
| 
						 | 
					@ -47,16 +47,20 @@ while [ $# -ge 1 ]; do
 | 
				
			||||||
   else
 | 
					   else
 | 
				
			||||||
      cdist-deploy-to "$1" | filter
 | 
					      cdist-deploy-to "$1" | filter
 | 
				
			||||||
   fi
 | 
					   fi
 | 
				
			||||||
 | 
					 | 
				
			||||||
   shift
 | 
					   shift
 | 
				
			||||||
done
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# else wait after all are started
 | 
					# else wait after all are started
 | 
				
			||||||
if [ "$parallel" ]; then
 | 
					if [ "$parallel" ]; then
 | 
				
			||||||
   __cdist_echo info "Waiting for cdist-deploy-to jobs to finish"
 | 
					   __cdist_echo info "Waiting for cdist-deploy-to jobs to finish"
 | 
				
			||||||
   while [ $i -gt 0 ]; do
 | 
					   while [ "$i" -gt 0 ]; do
 | 
				
			||||||
 | 
					      eval pid=\$pid_$i
 | 
				
			||||||
 | 
					      eval host=\$host_$i
 | 
				
			||||||
 | 
					      wait "$pid"
 | 
				
			||||||
 | 
					      if [ $? -ne 0 ]; then
 | 
				
			||||||
 | 
					         __cdist_echo error "Configuration of host $host failed."
 | 
				
			||||||
 | 
					      fi
 | 
				
			||||||
 | 
					      i=$((i-1))
 | 
				
			||||||
 | 
					      shift
 | 
				
			||||||
   done
 | 
					   done
 | 
				
			||||||
      
 | 
					 | 
				
			||||||
   wait
 | 
					 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue