MCPcopy
hub / github.com/benoitc/gunicorn / validate_user

Function validate_user

gunicorn/config.py:498–509  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

496
497
498def validate_user(val):
499 if val is None:
500 return os.geteuid()
501 if isinstance(val, int):
502 return val
503 elif val.isdigit():
504 return int(val)
505 else:
506 try:
507 return pwd.getpwnam(val).pw_uid
508 except KeyError:
509 raise ConfigError("No such user: '%s'" % val)
510
511
512def validate_group(val):

Callers

nothing calls this directly

Calls 1

ConfigErrorClass · 0.90

Tested by

no test coverage detected