Remove user from switch

    .. code-block:: bash

        salt '*' onyx.cmd remove_user username=daniel

def remove_user(username):
    '''
    Remove user from switch

    .. code-block:: bash

        salt '*' onyx.cmd remove_user username=daniel
    '''
    try:
        sendline('config terminal')
        user_line = 'no username {0}'.format(username)
        ret = sendline(user_line)
        sendline('end')
        sendline('copy running-config startup-config')
        return '\n'.join([user_line, ret])
    except TerminalException as e:
        log.error(e)
        return 'Failed to set password'