forked from ungleich-public/cdist
		
	always setup __cdist_out_object_dir, which needs to be done anyway
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								b44734e70a
							
						
					
				
			
			
				commit
				
					
						7a294bf41d
					
				
			
		
					 2 changed files with 7 additions and 10 deletions
				
			
		| 
						 | 
					@ -22,12 +22,9 @@
 | 
				
			||||||
# 
 | 
					# 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
. cdist-config
 | 
					. cdist-config
 | 
				
			||||||
[ $# -eq 3 ] || __cdist_usage "<object dir> <object> <type>"
 | 
					[ $# -eq 2 ] || __cdist_usage "<object> <type>"
 | 
				
			||||||
set -ue
 | 
					set -ue
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# This variable MUST be exactly like this - see __cdist_object_dir
 | 
					 | 
				
			||||||
__cdist_out_object_dir="$1"; shift
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
object="$1"; shift
 | 
					object="$1"; shift
 | 
				
			||||||
__cdist_gencode_type="$1"; shift
 | 
					__cdist_gencode_type="$1"; shift
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -50,7 +47,7 @@ echo "Checking code-${__cdist_gencode_type} for $object ..."
 | 
				
			||||||
if [ -f "$require" ]; then
 | 
					if [ -f "$require" ]; then
 | 
				
			||||||
   while read requirement; do
 | 
					   while read requirement; do
 | 
				
			||||||
      echo "Requiring  dependency $requirement for $object ..."
 | 
					      echo "Requiring  dependency $requirement for $object ..."
 | 
				
			||||||
      cdist-code-run "$__cdist_out_object_dir" "$requirement" "$__cdist_gencode_type"
 | 
					      cdist-code-run "$requirement" "$__cdist_gencode_type"
 | 
				
			||||||
   done < "$require"
 | 
					   done < "$require"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -38,13 +38,13 @@ while [ $# -ge 1 ]; do
 | 
				
			||||||
   object="$1"; shift
 | 
					   object="$1"; shift
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   # Code local
 | 
					   # Code local
 | 
				
			||||||
   cdist-code-run "$__cdist_out_object_dir" "$object" \
 | 
					   export __cdist_out_object_dir="$__cdist_out_object_dir"
 | 
				
			||||||
      "${__cdist_name_gencode_local}"                 \
 | 
					   cdist-code-run "$object" "${__cdist_name_gencode_local}"                 \
 | 
				
			||||||
         || __cdist_exit_err "Local code failed for $object"
 | 
					         || __cdist_exit_err "Local code failed for $object"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   # Code remote
 | 
					   # Code remote
 | 
				
			||||||
   cdist-run-remote "$__cdist_target_host"                                       \
 | 
					   cdist-run-remote "$__cdist_target_host"                                       \
 | 
				
			||||||
      "cdist-code-run" "${__cdist_remote_out_object_base_dir}" "$object"   \
 | 
					      "export __cdist_out_object_dir=\"$__cdist_remote_out_object_base_dir\";"   \
 | 
				
			||||||
      "${__cdist_name_gencode_remote}"                                     \
 | 
					      "cdist-code-run" "$object" "${__cdist_name_gencode_remote}"                \
 | 
				
			||||||
      || __cdist_exit_err "Remote code failed for $object"
 | 
					      || __cdist_exit_err "Remote code failed for $object"
 | 
				
			||||||
done < "$__cdist_tmp_file"
 | 
					done < "$__cdist_tmp_file"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue