From: Richard Purdie Date: Tue, 14 Jan 2020 21:05:10 +0000 (+0000) Subject: sstatesig: Improve debug output if getpwuid() fails X-Git-Tag: uninative-2.8~525 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=9d7a5219713af8117eda145052c6d9abdf577d8f;p=openembedded-core.git 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 --- diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py index 0e17ad6f5b..4325b66a9e 100644 --- a/meta/lib/oe/sstatesig.py +++ b/meta/lib/oe/sstatesig.py @@ -541,8 +541,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):