Skip to content

Commit

Permalink
Merge branch 'bug_11836/sharedfile_to_node_reports_repaired_even_if_i…
Browse files Browse the repository at this point in the history
…t_fails_pr' into branches/rudder/4.1
  • Loading branch information
peckpeck committed Feb 12, 2018
2 parents 28a7cb9 + 50b515c commit 78832c3
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tree/30_generic_methods/sharedfile_to_node.cf
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,13 @@ bundle agent sharedfile_to_node(target_uuid, file_id, file_path, ttl)
ifvarclass => "!${canonified_path}_signed";

_stdlib_path_exists_curl.pass2::
"${paths.path[curl]}"
args => "${url}?hash=${hash} -k -1 -L --head -o /dev/null -s -f ",
"code=`${paths.path[curl]} ${url}?hash=${hash} --insecure --tlsv1 --location --head --output /dev/null --silent --fail --write-out %{http_code}` || [ $code -eq 404 ] && exit 22 || exit 254"
contain => in_shell,
classes => classes_generic_return_single_code_two("${old_class_prefix}_exist", "${class_prefix}_exist", "0", "22", "999"), # 22 = http 400 or above
classes => classes_generic_return_single_code_two("${old_class_prefix}_exist", "${class_prefix}_exist", "0", "22", "254"), # 254 = http 400 or above, 22 = http 404
ifvarclass => "${canonified_path}_signed";

"echo | cat ${file_path}.sign - ${file_path} | ${paths.path[curl]}"
args => "${url}?ttl=${url_ttl} -k -1 -L -X PUT -o /dev/null -s -f -H 'Content-Type: application/octet-stream' --data-binary @-",
args => "${url}?ttl=${url_ttl} --insecure --tlsv1 --location --request PUT --output /dev/null --silent --fail --header 'Content-Type: application/octet-stream' --data-binary @-",
contain => in_shell,
classes => classes_generic_return_single_code_two("${old_class_prefix}_uploaded", "${class_prefix}_uploaded", "0", "999", "22"), # 22 = http 400 or above
ifvarclass => "${canonified_path}_signed.(${old_class_prefix}_exist_repaired|${class_prefix}_exist_repaired)";
Expand Down

0 comments on commit 78832c3

Please sign in to comment.