diff options
author | kali <kali@leap.se> | 2013-01-25 01:55:04 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2013-01-25 01:55:04 +0900 |
commit | b9cba4bc7b88420e0ee46a6f03dd4aa2fb1edd1e (patch) | |
tree | 136fcde8955f00ac42ca2054a3108bd4bc0de064 /src/leap/base | |
parent | b093b632049e1cf4c61d714c025831fb8d373ed7 (diff) | |
parent | d02402a147bbae945618befdb8a1a260a91ce7a6 (diff) |
Merge branch 'develop' of ssh://leap.se/leap_client into develop
Diffstat (limited to 'src/leap/base')
-rw-r--r-- | src/leap/base/config.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/leap/base/config.py b/src/leap/base/config.py index e235e5c3..7021cb0f 100644 --- a/src/leap/base/config.py +++ b/src/leap/base/config.py @@ -333,7 +333,14 @@ def validate_ip(ip_str): def get_username(): - return os.getlogin() + try: + return os.getlogin() + except OSError as e: + if e.message == "[Errno 22] Invalid argument": + import pwd + return pwd.getpwuid(os.getuid())[0] + else: + raise OSError(e.message) def get_groupname(): |