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 5e1aec5aa2
commit c5d151197b

View File

@ -8,7 +8,6 @@ involves preparing the three listeners and the workers needed by the master.
import os
import re
import logging
import getpass
import shutil
import datetime
try:
@ -120,7 +119,7 @@ def access_keys(opts):
acl_users = set(opts['client_acl'].keys())
if opts.get('user'):
acl_users.add(opts['user'])
acl_users.add(getpass.getuser())
acl_users.add(salt.utils.get_user())
for user in pwd.getpwall():
users.append(user.pw_name)
for user in acl_users:
@ -1235,7 +1234,7 @@ class LocalFuncs(object):
'Authentication failure of type "user" occurred.'
)
return ''
elif load['user'] == getpass.getuser():
elif load['user'] == salt.utils.get_user():
if load.pop('key') != self.key.get(load['user']):
log.warning(
'Authentication failure of type "user" occurred.'
@ -1273,7 +1272,7 @@ class LocalFuncs(object):
)
return ''
else:
if load.pop('key') != self.key[getpass.getuser()]:
if load.pop('key') != self.key[salt.utils.get_user()]:
log.warning(
'Authentication failure of type "other" occurred.'
)