def chfullname(name, fullname):
    if isinstance(fullname, string_types):
        fullname = _sdecode(fullname)
    pre_info = info(name)
    if not pre_info:
        raise CommandExecutionError('User \'{0}\' does not exist'.format(name))
    if isinstance(pre_info['fullname'], string_types):
        pre_info['fullname'] = _sdecode(pre_info['fullname'])
    if fullname == pre_info['fullname']:
        return True
    _dscl(
        ['/Users/{0}'.format(name), 'RealName', fullname],
        # use a 'create' command, because a 'change' command would fail if
        # current fullname is an empty string. The 'create' will just overwrite
        # this field.
        ctype='create'
    )
    # dscl buffers changes, sleep 1 second before checking if new value
    # matches desired value
    time.sleep(1)

    current = info(name).get('fullname')
    if isinstance(current, string_types):
        current = _sdecode(current)
    return current == fullname
Change the user's Full Name
dataset/ETHPy150Open saltstack/salt/salt/modules/mac_user.py/chfullname