RobertLuptonTheGood/eups — pull request #33 by segasai (2014-12-09 15:05:14+00:00)
Title: ensure that eups is working when getpwuid is not (e.g. on NERSC hopper)

Hi,

By default eups fails on platforms where getpwuid doesn't work.
```
Traceback (most recent call last):
File "/global/homes/k/koposov/lsst92new/Linux64/obs_sdss/9.0+11/bin/processCcdSdss.py", line 23, in
from lsst.obs.sdss.processCcdSdss import ProcessCcdSdssTask
File "/global/homes/k/koposov/lsst92new/Linux64/obs_sdss/9.0+11/python/lsst/obs/sdss/__init__.py", line 23, in
from sdssMapper import *
File "/global/homes/k/koposov/lsst92new/Linux64/obs_sdss/9.0+11/python/lsst/obs/sdss/sdssMapper.py", line 25, in
from lsst.daf.butlerUtils import CameraMapper, exposureFromImage
File "/global/homes/k/koposov/lsst92new/Linux64/daf_butlerUtils/9.0+8/python/lsst/daf/butlerUtils/__init__.py", line 27, in
from cameraMapper import *
File "/global/homes/k/koposov/lsst92new/Linux64/daf_butlerUtils/9.0+8/python/lsst/daf/butlerUtils/cameraMapper.py", line 30, in
import eups
File "/global/homes/k/koposov/lsst92new/eups/python/eups/__init__.py", line 2, in
from tags import Tags, Tag, TagNotRecognized
File "/global/homes/k/koposov/lsst92new/eups/python/eups/tags.py", line 5, in
who = pwd.getpwuid(os.geteuid())[0]
KeyError: 'getpwuid(): uid not found: 63122'
```

Here is the patch which uses the USER environment variable instead if getpwuid doesnt' have the current user ID.
It seems to fix the issue on NERSC.

One way to test this patch is to temporarily remove the user from passwd.

Sergey