Replace refs to getpass.getuser() with salt.utils.get_user()

This commit is contained in:
Erik Johnson 2014-04-01 14:28:21 -05:00
parent 8f50fa1e78
commit ebd038e0d5

View File

@ -17,7 +17,6 @@ import difflib
import errno import errno
import fileinput import fileinput
import fnmatch import fnmatch
import getpass
import hashlib import hashlib
import itertools import itertools
import logging import logging
@ -220,7 +219,7 @@ def user_to_uid(user):
salt '*' file.user_to_uid root salt '*' file.user_to_uid root
''' '''
if not user: if not user:
user = getpass.getuser() user = salt.utils.get_user()
try: try:
return pwd.getpwnam(user).pw_uid return pwd.getpwnam(user).pw_uid
except KeyError: except KeyError: