During the installing of packages if yum runs out of free disk space, some post install scripts could fail (like e.g. when the kernel package generates initramfs), but yum would still exit with a status 0. This is bad, especially for the kernel package, because it makes it unable to boot. Because the yum module is usually used for automation, which means the users cannot read every message yum prints, it's better that the yum module fails if it detects that there is no free space on the disk.
This commit is contained in:
parent
84bedcbd82
commit
5cbda9658a
1 changed files with 10 additions and 0 deletions
|
@ -830,6 +830,16 @@ def exec_install(module, items, action, pkgs, res, yum_basecmd):
|
||||||
res['changed'] = False
|
res['changed'] = False
|
||||||
module.fail_json(**res)
|
module.fail_json(**res)
|
||||||
|
|
||||||
|
# Fail if yum prints 'No space left on device' because that means some
|
||||||
|
# packages failed executing their post install scripts because of lack of
|
||||||
|
# free space (e.g. kernel package couldn't generate initramfs). Note that
|
||||||
|
# yum can still exit with rc=0 even if some post scripts didn't execute
|
||||||
|
# correctly.
|
||||||
|
if 'No space left on device' in (out or err):
|
||||||
|
res['changed'] = False
|
||||||
|
res['msg'] = 'No space left on device'
|
||||||
|
module.fail_json(**res)
|
||||||
|
|
||||||
# FIXME - if we did an install - go and check the rpmdb to see if it actually installed
|
# FIXME - if we did an install - go and check the rpmdb to see if it actually installed
|
||||||
# look for each pkg in rpmdb
|
# look for each pkg in rpmdb
|
||||||
# look for each pkg via obsoletes
|
# look for each pkg via obsoletes
|
||||||
|
|
Loading…
Reference in a new issue