From 262a05e53961de69b5a3a053f6f4314e22dfe284 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Thu, 15 Sep 2011 19:27:31 -0400 Subject: [PATCH] ltmpl: continue loop if installpkg can't find something Otherwise, something like: installpkg missing-thingy kernel kernel-firmware will leave you without a kernel. --- src/pylorax/ltmpl.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pylorax/ltmpl.py b/src/pylorax/ltmpl.py index efb392a6..55cfeecd 100644 --- a/src/pylorax/ltmpl.py +++ b/src/pylorax/ltmpl.py @@ -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): '''