diff --git a/lib/spack/spack/directory_layout.py b/lib/spack/spack/directory_layout.py index 242eb1afa0443c..dbaee37a4e54ae 100644 --- a/lib/spack/spack/directory_layout.py +++ b/lib/spack/spack/directory_layout.py @@ -282,7 +282,7 @@ def check_installed(self, spec): return path if spec.dag_hash() == installed_spec.dag_hash(): - raise SpecHashCollisionError(installed_hash, spec_hash) + raise SpecHashCollisionError(spec, installed_spec) else: raise InconsistentInstallDirectoryError( 'Spec file in %s does not match hash!' % spec_file_path) @@ -428,7 +428,7 @@ class SpecHashCollisionError(DirectoryLayoutError): def __init__(self, installed_spec, new_spec): super(SpecHashCollisionError, self).__init__( 'Specs %s and %s have the same SHA-1 prefix!' - % installed_spec, new_spec) + % (installed_spec, new_spec)) class RemoveFailedError(DirectoryLayoutError):