Browse Source

Replace uid2user(os.getuid()) with getpass.getuser()

Marian Beermann 9 years ago
parent
commit
cc6a58bab7
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/borg/helpers.py

+ 2 - 1
src/borg/helpers.py

@@ -1,4 +1,5 @@
 import argparse
 import argparse
+import getpass
 import hashlib
 import hashlib
 import logging
 import logging
 import os
 import os
@@ -593,7 +594,7 @@ def replace_placeholders(text):
         'hostname': socket.gethostname(),
         'hostname': socket.gethostname(),
         'now': current_time.now(),
         'now': current_time.now(),
         'utcnow': current_time.utcnow(),
         'utcnow': current_time.utcnow(),
-        'user': uid2user(os.getuid(), os.getuid()),
+        'user': getpass.getuser(),
         'uuid4': str(uuid.uuid4()),
         'uuid4': str(uuid.uuid4()),
     }
     }
     return format_line(text, data)
     return format_line(text, data)