<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _fmadm_action_fmri(action, fmri):
    '''
    Internal function for fmadm.repqired, fmadm.replaced, fmadm.flush
    '''
    ret = {}
    fmadm = _check_fmadm()
    cmd = '{cmd} {action} {fmri}'.format(
        cmd=fmadm,
        action=action,
        fmri=fmri
    )
    res = __salt__['cmd.run_all'](cmd)
    retcode = res['retcode']
    result = {}
    if retcode != 0:
        result['Error'] = res['stderr']
    else:
        result = True

    return result