diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2018-11-03 00:39:24 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2018-11-09 00:31:24 -0800 |
commit | 62f8ea1a75e56a2da289e8ffe9651bc62dab4d89 (patch) | |
tree | e9e40090ac6dbf9d66939bd89be160141f345d33 | |
parent | 13aca774e3af1040e916bc9c53f1f84c6a42cc44 (diff) | |
download | spack-62f8ea1a75e56a2da289e8ffe9651bc62dab4d89.tar.gz spack-62f8ea1a75e56a2da289e8ffe9651bc62dab4d89.tar.bz2 spack-62f8ea1a75e56a2da289e8ffe9651bc62dab4d89.tar.xz spack-62f8ea1a75e56a2da289e8ffe9651bc62dab4d89.zip |
env: rename EnvError to SpackEnvironmentError
-rw-r--r-- | lib/spack/spack/cmd/uninstall.py | 2 | ||||
-rw-r--r-- | lib/spack/spack/environment.py | 21 |
2 files changed, 10 insertions, 13 deletions
diff --git a/lib/spack/spack/cmd/uninstall.py b/lib/spack/spack/cmd/uninstall.py index 6425e88d9e..cb02aa4f41 100644 --- a/lib/spack/spack/cmd/uninstall.py +++ b/lib/spack/spack/cmd/uninstall.py @@ -168,7 +168,7 @@ def do_uninstall(specs, force): if ev.active: try: ev.active.remove(item, force=True) - except ev.EnvError: + except ev.SpackEnvironmentError: pass # ignore errors from specs that are not roots # Sort packages to be uninstalled by the number of installed dependents diff --git a/lib/spack/spack/environment.py b/lib/spack/spack/environment.py index 70bba192d7..2a0a6c0137 100644 --- a/lib/spack/spack/environment.py +++ b/lib/spack/spack/environment.py @@ -195,7 +195,7 @@ def disambiguate(env, env_dir=None): if is_env_dir(env_dir): return Environment(env_dir) else: - raise EnvError('no environment in %s' % env_dir) + raise SpackEnvironmentError('no environment in %s' % env_dir) return None @@ -223,7 +223,7 @@ def read(name): """Get an environment with the supplied name.""" validate_env_name(name) if not exists(name): - raise EnvError("no such environment '%s'" % name) + raise SpackEnvironmentError("no such environment '%s'" % name) return Environment(root(name)) @@ -231,7 +231,7 @@ def create(name, init_file=None): """Create a named environment in Spack.""" validate_env_name(name) if exists(name): - raise EnvError("'%s': environment already exists" % name) + raise SpackEnvironmentError("'%s': environment already exists" % name) return Environment(root(name), init_file) @@ -472,9 +472,10 @@ class Environment(object): """ spec = Spec(user_spec) if not spec.name: - raise EnvError('cannot add anonymous specs to an environment!') + raise SpackEnvironmentError( + 'cannot add anonymous specs to an environment!') elif not spack.repo.path.exists(spec.name): - raise EnvError('no such package: %s' % spec.name) + raise SpackEnvironmentError('no such package: %s' % spec.name) existing = set(s for s in self.user_specs if s.name == spec.name) if not existing: @@ -498,7 +499,7 @@ class Environment(object): s for s, h in specs_hashes if query_spec.dag_hash() == h] if not matches: - raise EnvError("Not found: {0}".format(query_spec)) + raise SpackEnvironmentError("Not found: {0}".format(query_spec)) for spec in matches: if spec in self.user_specs: @@ -860,9 +861,5 @@ def deactivate_config_scope(env): spack.config.config.remove_scope(scope.name) -class EnvError(spack.error.SpackError): - """Superclass for all errors to do with Spack environments. - - Note that this is called ``EnvError`` to distinguish it from the - builtin ``EnvironmentError``. - """ +class SpackEnvironmentError(spack.error.SpackError): + """Superclass for all errors to do with Spack environments.""" |