summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Scheibel <scheibel1@llnl.gov>2015-10-23 16:18:06 -0700
committerPeter Scheibel <scheibel1@llnl.gov>2015-10-23 16:18:06 -0700
commitd76c9236236747a2a19a10941b1efd497f0202e0 (patch)
treed1c21d762e74b097972fac02ea16a653378fd9bb
parentea872f8098af3525f0d3e9e0d2fd2efa41466e87 (diff)
downloadspack-d76c9236236747a2a19a10941b1efd497f0202e0.tar.gz
spack-d76c9236236747a2a19a10941b1efd497f0202e0.tar.bz2
spack-d76c9236236747a2a19a10941b1efd497f0202e0.tar.xz
spack-d76c9236236747a2a19a10941b1efd497f0202e0.zip
1. Rename CommandError -> InstallError
2. InstallError now subclasses SpackError vs. StandardError (so it is now handled by the spack shell script)
-rw-r--r--lib/spack/spack/build_environment.py8
-rw-r--r--lib/spack/spack/cmd/test-install.py4
2 files changed, 7 insertions, 5 deletions
diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py
index 0d179f563b..620ad5be9e 100644
--- a/lib/spack/spack/build_environment.py
+++ b/lib/spack/spack/build_environment.py
@@ -36,6 +36,7 @@ from llnl.util.filesystem import *
import spack
import spack.compilers as compilers
+from spack.error import SpackError
from spack.util.executable import Executable, which
from spack.util.environment import *
@@ -296,8 +297,9 @@ def fork(pkg, function):
# message. Just make the parent exit with an error code.
pid, returncode = os.waitpid(pid, 0)
if returncode != 0:
- raise CommandError(returncode)
+ raise InstallError("Installation process had nonzero exit code."
+ .format(str(returncode)))
-class CommandError(StandardError):
- pass
+class InstallError(SpackError):
+ """Raised when a package fails to install"""
diff --git a/lib/spack/spack/cmd/test-install.py b/lib/spack/spack/cmd/test-install.py
index aeb90ae733..a9f9331fcb 100644
--- a/lib/spack/spack/cmd/test-install.py
+++ b/lib/spack/spack/cmd/test-install.py
@@ -32,7 +32,7 @@ import llnl.util.tty as tty
from llnl.util.filesystem import *
import spack
-from spack.build_environment import CommandError
+from spack.build_environment import InstallError
import spack.cmd
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,
verbose=True,
fake=False)
- except CommandError:
+ except InstallError:
pass
jrf = JunitResultFormat()