Mercurial > p > roundup > code
comparison roundup/logcontext.py @ 8449:756cdf8e34f2
fix: os.getlogin fails with OSError in CI.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Wed, 17 Sep 2025 01:31:12 -0400 |
| parents | 3df6b8988074 |
| children | df9fc9080e5a |
comparison
equal
deleted
inserted
replaced
| 8448:3df6b8988074 | 8449:756cdf8e34f2 |
|---|---|
| 150 elif location == "client" and 'REQUEST_URI' in args[3]: | 150 elif location == "client" and 'REQUEST_URI' in args[3]: |
| 151 reason = args[3]['REQUEST_URI'] | 151 reason = args[3]['REQUEST_URI'] |
| 152 elif location == "mailgw": | 152 elif location == "mailgw": |
| 153 reason = args[1].get_header('message-id', "no_message_id") | 153 reason = args[1].get_header('message-id', "no_message_id") |
| 154 elif location == "admin": | 154 elif location == "admin": |
| 155 reason = "roundup-admin(%s): %s" % (os.getlogin(), args[1][:2]) | 155 try: |
| 156 login = os.getlogin() | |
| 157 except OSError: | |
| 158 login = "unknown" | |
| 159 reason = "roundup-admin(%s): %s" % (login, args[1][:2]) | |
| 156 elif location.startswith("file://"): | 160 elif location.startswith("file://"): |
| 157 reason = location | 161 reason = location |
| 158 elif location == "client_main" and 'REQUEST_URI' in args[0].env: | 162 elif location == "client_main" and 'REQUEST_URI' in args[0].env: |
| 159 reason = args[0].env['REQUEST_URI'] | 163 reason = args[0].env['REQUEST_URI'] |
| 160 elif location == "xmlrpc-server": | 164 elif location == "xmlrpc-server": |
