def __apf_cmd(cmd):
    '''
    Return the apf location
    '''
    apf_cmd = '{0} {1}'.format(salt.utils.path.which('apf'), cmd)
    out = __salt__['cmd.run_all'](apf_cmd)

    if out['retcode'] != 0:
        if not out['stderr']:
            msg = out['stdout']
        else:
            msg = out['stderr']
        raise CommandExecutionError(
            'apf failed: {0}'.format(msg)
        )
    return out['stdout']