1. Rename CommandError -> InstallError
2. InstallError now subclasses SpackError vs. StandardError (so it is now handled by the spack shell script)
This commit is contained in:
parent
ea872f8098
commit
d76c923623
@ -36,6 +36,7 @@
|
|||||||
|
|
||||||
import spack
|
import spack
|
||||||
import spack.compilers as compilers
|
import spack.compilers as compilers
|
||||||
|
from spack.error import SpackError
|
||||||
from spack.util.executable import Executable, which
|
from spack.util.executable import Executable, which
|
||||||
from spack.util.environment import *
|
from spack.util.environment import *
|
||||||
|
|
||||||
@ -296,8 +297,9 @@ def child_fun():
|
|||||||
# message. Just make the parent exit with an error code.
|
# message. Just make the parent exit with an error code.
|
||||||
pid, returncode = os.waitpid(pid, 0)
|
pid, returncode = os.waitpid(pid, 0)
|
||||||
if returncode != 0:
|
if returncode != 0:
|
||||||
raise CommandError(returncode)
|
raise InstallError("Installation process had nonzero exit code."
|
||||||
|
.format(str(returncode)))
|
||||||
|
|
||||||
|
|
||||||
class CommandError(StandardError):
|
class InstallError(SpackError):
|
||||||
pass
|
"""Raised when a package fails to install"""
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
from llnl.util.filesystem import *
|
from llnl.util.filesystem import *
|
||||||
|
|
||||||
import spack
|
import spack
|
||||||
from spack.build_environment import CommandError
|
from spack.build_environment import InstallError
|
||||||
import spack.cmd
|
import spack.cmd
|
||||||
|
|
||||||
description = "Treat package installations as unit tests and output formatted test results"
|
description = "Treat package installations as unit tests and output formatted test results"
|
||||||
@ -190,7 +190,7 @@ def test_install(parser, args):
|
|||||||
make_jobs=args.jobs,
|
make_jobs=args.jobs,
|
||||||
verbose=True,
|
verbose=True,
|
||||||
fake=False)
|
fake=False)
|
||||||
except CommandError:
|
except InstallError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
jrf = JunitResultFormat()
|
jrf = JunitResultFormat()
|
||||||
|
Loading…
Reference in New Issue
Block a user