Merge "Avoid catching pgrep apt from ssh source to self"

This commit is contained in:
Jenkins 2017-01-11 14:03:59 +00:00 committed by Gerrit Code Review
commit 908aa6dca7
1 changed files with 1 additions and 1 deletions

View File

@ -210,7 +210,7 @@ installed_ansible_version=$(admin_node_command dpkg-query -W -f='\${Version}\\n'
if ! admin_node_command type ansible > /dev/null || \
dpkg --compare-versions "$installed_ansible_version" "lt" "$required_ansible_version"; then
# Wait for apt lock in case it is updating from cron job
while admin_node_command pgrep -a -f apt; do echo 'Waiting for apt lock...'; sleep 30; done
while admin_node_command pgrep -a -f '[^ssh].*apt'; do echo 'Waiting for apt lock...'; sleep 30; done
case $ADMIN_NODE_BASE_OS in
ubuntu)
with_retries admin_node_command -- sudo apt-get update