fedora-infra / koschei

Continuous integration for Fedora packages
GNU General Public License v2.0
37 stars 15 forks source link

[admin] Don't try to resolve user name if SUDO_USER is set #285

Closed mizdebsk closed 5 years ago

mizdebsk commented 5 years ago

Fixes #282

OpenShift-created UIDs don't have corresponding user names. Koschei would try to eagerly resolve user name, even if SUDO_USER was set.

This change prevents crash in OpenShift with error like: KeyError: 'getpwuid(): uid not found: 1000550000'

codecov[bot] commented 5 years ago

Codecov Report

Merging #285 into master will increase coverage by <.01%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #285      +/-   ##
==========================================
+ Coverage   84.37%   84.38%   +<.01%     
==========================================
  Files          42       42              
  Lines        3763     3765       +2     
==========================================
+ Hits         3175     3177       +2     
  Misses        588      588
Impacted Files Coverage Δ
koschei/admin.py 79.73% <100%> (+0.1%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e2bc586...6298f10. Read the comment docs.