

def _worker_status(target, worker, activation, profile='default', expr_form='glob'):
    "\n    Check if the worker is in `activation` state in the targeted load balancers\n\n    The function will return the following dictionary:\n        result - False if no server returned from the published command\n        errors - list of servers that couldn't find the worker\n        wrong_state - list of servers that the worker was in the wrong state\n                      (not activation)\n    "
    ret = {
        'result': True,
        'errors': [],
        'wrong_state': [],
    }
    args = [worker, profile]
    status = __salt__['publish.publish'](target, 'modjk.worker_status', args, expr_form)
    if (not status):
        ret['result'] = False
        return ret
    for balancer in status:
        if (not status[balancer]):
            ret['errors'].append(balancer)
        elif (status[ret]['activation'] != activation):
            ret['wrong_state'].append(balancer)
    return ret

dataset/ETHPy150Open saltstack/salt/salt/states/modjk_worker.py _worker_status/VarMisuse@123/304 `balancer`->`ret`