Skip to content

Commit

Permalink
Merge pull request #87 from wawaka/os_name_fallback_to_uid
Browse files Browse the repository at this point in the history
fallback for os_name if user name is not defined
  • Loading branch information
xzkostyan committed May 21, 2019
2 parents 4592862 + 1c59b79 commit 9dd6ca0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion clickhouse_driver/clientinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ class QueryKind(object):
def __init__(self, client_name):
self.query_kind = ClientInfo.QueryKind.NO_QUERY

self.os_user = getpass.getuser()
try:
self.os_user = getpass.getuser()
except KeyError:
self.os_user = ''
self.client_hostname = socket.gethostname()
self.client_name = client_name

Expand Down

0 comments on commit 9dd6ca0

Please sign in to comment.