Skip to content

Commit

Permalink
ceph-backport.sh: fix bugs in data_binary generation
Browse files Browse the repository at this point in the history
The recently added code for generating the JSON for updating the PR milestone
and labels, via the --data-binary option of curl, was buggy.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
  • Loading branch information
smithfarm committed Nov 7, 2019
1 parent 400c937 commit c931760
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/script/ceph-backport.sh
Expand Up @@ -813,7 +813,7 @@ function maybe_update_pr_milestone_labels {
needs_milestone="$(backport_pr_needs_milestone)"
if [ "$needs_milestone" ] ; then
debug "Attempting to set ${milestone} milestone in ${backport_pr_url}"
data_binary="${data_binary}\"milestone\":\"${milestone_number}\""
data_binary="${data_binary}\"milestone\":${milestone_number}"
else
info "Backport PR ${backport_pr_url} already has ${milestone} milestone"
fi
Expand All @@ -824,7 +824,9 @@ function maybe_update_pr_milestone_labels {
fi
data_binary="${data_binary}\"labels\":[\"${component}\""
while read -r label ; do
data_binary="${data_binary},\"${label}\""
if [ "$label" ] ; then
data_binary="${data_binary},\"${label}\""
fi
done <<< "$backport_pr_labels"
data_binary="${data_binary}]}"
else
Expand Down

0 comments on commit c931760

Please sign in to comment.