ltmpl: continue loop if installpkg can't find something

Otherwise, something like:
  installpkg missing-thingy kernel kernel-firmware
will leave you without a kernel.
This commit is contained in:
Will Woods 2011-09-15 19:27:31 -04:00
parent 318c843e37
commit 262a05e539
1 changed files with 5 additions and 1 deletions

View File

@ -382,7 +382,11 @@ class LoraxTemplateRunner(object):
until the 'run_pkg_transaction' command is given.
'''
for p in pkgs:
self.yum.install(pattern=p)
try:
self.yum.install(pattern=p)
except Exception as e:
# TODO: save exception and re-raise after the loop finishes
logger.warn("installpkg %s failed: %s",p,str(e))
def removepkg(self, *pkgs):
'''