diff options
author | Gregory Becker <becker33@llnl.gov> | 2015-11-04 12:50:22 -0800 |
---|---|---|
committer | Gregory Becker <becker33@llnl.gov> | 2015-11-04 12:50:22 -0800 |
commit | 5ac974c9b2072631eab490cce8f2922420eef9e4 (patch) | |
tree | 810002cba395c33c505f907d5a7cd4008136e15c /lib | |
parent | 058e72d29c3cd934f91ba626392b25ebaa50e2cc (diff) | |
download | spack-5ac974c9b2072631eab490cce8f2922420eef9e4.tar.gz spack-5ac974c9b2072631eab490cce8f2922420eef9e4.tar.bz2 spack-5ac974c9b2072631eab490cce8f2922420eef9e4.tar.xz spack-5ac974c9b2072631eab490cce8f2922420eef9e4.zip |
Enforced that the architecture subclass cannot add a target that shares a name with a target alias
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/architecture.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py index 442180242b..890df9b1e5 100644 --- a/lib/spack/spack/architecture.py +++ b/lib/spack/spack/architecture.py @@ -77,9 +77,14 @@ class Architecture(object): self.name = name def add_target(self, name, target): - self.targets[name] = target - - + """Used by the architecture specific subclass to list available targets. Raises an error + if the architecture specifies a name that is reserved by spack as an alias. + """ + if name in ['front_end', 'fe', 'back_end', 'be', 'default']: + raise ValueError("%s is a spack reserved alias and cannot be the name of a target" % name) + self.targets[name] = target + + def target(self, name): """This is a getter method for the target dictionary that handles defaulting based on the values provided by default, front-end, and back-end. This can be overwritten |