mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Replace refs to getpass.getuser() with salt.utils.get_user()
This commit is contained in:
parent
8f50fa1e78
commit
ebd038e0d5
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user