Merge pull request #1181 from rallytime/fix-zypper-process-lock-problem

Wait for zypper processes to finish before calling zypper again
This commit is contained in:
Nicole Thomas 2017-12-16 08:15:47 -05:00 committed by GitHub
commit 0b300938ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -5456,6 +5456,13 @@ __version_lte() {
}
__zypper() {
# Check if any zypper process is running before calling zypper again.
# This is useful when a zypper call is part of a boot process and will
# wait until the zypper process is finished, such as on AWS AMIs.
while pgrep -l zypper; do
sleep 1
done
zypper --non-interactive "${@}"; return $?
}