+ 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 exnYou 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.
_______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list