Merge "Make tasks upload on package upgrade idempotent"

This commit is contained in:
Jenkins 2017-03-06 11:58:12 +00:00 committed by Gerrit Code Review
commit d7fdaac5ad
2 changed files with 17 additions and 2 deletions

View File

@ -16,12 +16,20 @@ for i in `fuel2 release list | grep -e Ubuntu | grep -v unavailable | awk '{ pri
existing_releases=`fuel2 sequence list -r$i | grep deploy-changes | awk '{ print $4 }'`
if ! [[ ${existing_releases[*]} =~ "$i" ]]
then
fuel2 sequence create -r$i -n deploy-changes -t net-verification deletion provision deploy
fuel2 sequence create -r$i -n deploy-changes -t net-verification deletion provision default
rc=$?
if [[ $rc -eq 1 ]];
then
echo "Problem with sequence creation for release with id ${i} - command exited with ${rc} code"
exit 1
fi
else
fuel2 sequence update -r$i -n deploy-changes -t net-verification deletion provision default
rc=$?
if [[ $rc -eq 1 ]];
then
echo "Problem with sequence update for release with id ${i} - command exited with ${rc} code"
exit 1
fi
fi
done

View File

@ -145,7 +145,14 @@ done
# Create symlink for deployment graph
# TODO(sbog): remove this when deployment graph will be splitted to separate
# subgraphs
ln -sf /etc/puppet/modules /etc/fuel/graphs/deploy
if [ -L /etc/fuel/graphs/default ]
then
unlink /etc/fuel/graphs/default
elif [ -d /etc/fuel/graphs/default ]
then
mv /etc/fuel/graphs/default /etc/fuel/graphs/default.old
fi
ln -sf /etc/puppet/modules /etc/fuel/graphs/default
if [ "$1" = 2 ]; then
#Try to sync deployment tasks or notify user on upgrade