diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-01-14 21:05:10 +0000 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2020-01-18 14:04:27 -0800 |
commit | 2bba0052597020ea887c84419440df11f9859283 (patch) | |
tree | f00c3b2b37eea74c1496cc9d5973e3d14268689f | |
parent | 232b2f6dabaedff087df15a7e6d431dd9f314b4c (diff) | |
download | openembedded-core-contrib-2bba0052597020ea887c84419440df11f9859283.tar.gz |
sstatesig: Improve debug output if getpwuid() fails
If getpwduid fails, we don't see which file it failed on which is key information
to aid debugging. Print this information when exceptions are raised.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 9d7a5219713af8117eda145052c6d9abdf577d8f)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r-- | meta/lib/oe/sstatesig.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py index 24a221eb1a..b2316b12b8 100644 --- a/meta/lib/oe/sstatesig.py +++ b/meta/lib/oe/sstatesig.py @@ -521,8 +521,12 @@ def OEOuthashBasic(path, sigfile, task, d): add_perm(stat.S_IXOTH, 'x') if include_owners: - update_hash(" %10s" % pwd.getpwuid(s.st_uid).pw_name) - update_hash(" %10s" % grp.getgrgid(s.st_gid).gr_name) + try: + update_hash(" %10s" % pwd.getpwuid(s.st_uid).pw_name) + update_hash(" %10s" % grp.getgrgid(s.st_gid).gr_name) + except KeyError: + bb.warn("KeyError in %s" % path) + raise update_hash(" ") if stat.S_ISBLK(s.st_mode) or stat.S_ISCHR(s.st_mode): |