diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2019-08-20 14:52:53 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2019-08-20 14:52:53 -0700 |
commit | 368bf2d69c2fbb1b092ebe48b557027c453db9d2 (patch) | |
tree | 25dd89c9b5036c711f69061af412723cd839ffcf /lib | |
parent | a41014ed9e5b2a8bfa91a88f52dd60823c65aa89 (diff) | |
download | spack-368bf2d69c2fbb1b092ebe48b557027c453db9d2.tar.gz spack-368bf2d69c2fbb1b092ebe48b557027c453db9d2.tar.bz2 spack-368bf2d69c2fbb1b092ebe48b557027c453db9d2.tar.xz spack-368bf2d69c2fbb1b092ebe48b557027c453db9d2.zip |
stage: avoid using group name in _first_accessible_path()
On machines where $TMP is owned by a gid with no name, this avoids the
following error when the default spack stage does not exist:
(spackbook):spack$ spack clean
==> Removing all temporary build stages
==> Error: 'getgrgid(): gid not found: 57095'
Spack needs to deal with gids directly unless users pass them in.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/stage.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/spack/spack/stage.py b/lib/spack/spack/stage.py index 5dc2a8ddfc..3410e8b63e 100644 --- a/lib/spack/spack/stage.py +++ b/lib/spack/spack/stage.py @@ -3,7 +3,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import grp import os import stat import sys @@ -56,8 +55,8 @@ def _first_accessible_path(paths): if not os.path.exists(prefix): break parent = os.path.dirname(prefix) - group = grp.getgrgid(os.stat(parent).st_gid)[0] - mkdirp(path, group=group, default_perms='parents') + gid = os.stat(parent).st_gid + mkdirp(path, group=gid, default_perms='parents') if can_access(path): return path |