[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: OSTree <3 Anaconda



On Fri, Mar 21, 2014 at 3:07 PM, Brian C. Lane <bcl redhat com> wrote:
+ def _safeExecWithRedirect(self, cmd, argv, **kwargs): + """Like iutil.execWithRedirect, but treat errors as fatal""" + rc = iutil.execWithRedirect(cmd, argv, **kwargs) + if rc != 0: + exn = PayloadInstallError("%s %s exited with code %d" % (cmd, argv, rc)) + if errorHandler.cb(exn) == ERROR_RAISE: + raise exn
You may as well add this to iutil as another variation on ExecWith

I don't think I can throw a PayloadInstallError from iutil, which raises the question of which exception.  Maybe subprocess.CalledProcessError?

Do we need to duplicate the bits to invoke errorHandler in all of these subprocess calls?  Since all of these errors are fatal, it seems like a toplevel handler should catch them anyways.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]