From 34386c35c2a007e43b895da1e84a7d6ff55132af Mon Sep 17 00:00:00 2001 From: Tom Aldcroft Date: Fri, 2 Oct 2020 17:44:44 -0400 Subject: [PATCH] Use getpass.getuser() instead of USER env var --- ska_sync/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ska_sync/main.py b/ska_sync/main.py index e37ad5c..bbd060c 100644 --- a/ska_sync/main.py +++ b/ska_sync/main.py @@ -8,6 +8,7 @@ ========= """ import os +import getpass import yaml @@ -82,7 +83,7 @@ def main(): print('Loaded config from {}'.format(config_path)) # Remote user name - user = opt.user or config.get('user') or os.environ['USER'] + user = opt.user or config.get('user') or getpass.getuser() file_sync(config['file_sync'], user, config['host'])