def _username():
    if pwd:
        username = pwd.getpwuid(os.getuid()).pw_name
    else:
        username = getpass.getuser()

    return username
Grain for the minion username
dataset/ETHPy150Open saltstack/salt/salt/grains/minion_process.py/_username