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
5e1aec5aa2
commit
c5d151197b
@ -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.'
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user