def recover_all(lbn, profile='default'):
 ret = {}
 config = get_running(profile)
 try:
  workers_ = config['worker.{0}.balance_workers'.format(lbn)].split(',')
 except KeyError:
  return ret
 for worker in workers_:
  curr_state = worker_status(worker, profile)
  if (curr_state['activation'] != 'ACT'):
   worker_activate(worker, lbn, profile)
  if (not curr_state['state'].startswith('OK')):
   worker_recover(worker, lbn, profile)
  ret[worker] = worker_status(worker, profile)
 return ret

def recover_all ( lbn , profile = 'default' ) : ret = { } config = get_running ( profile ) try : workers_ = config [ 'worker.{0}.balance_workers' . format ( lbn ) ] . split ( ',' ) except KeyError : return ret for worker in workers_ : curr_state = worker_status ( worker , profile ) if ( curr_state [ 'activation' ] != 'ACT' ) : worker_activate ( worker , lbn , profile ) if ( not curr_state [ 'state' ] . startswith ( 'OK' ) ) : worker_recover ( worker , lbn , profile ) ret [ worker ] = worker_status ( worker , profile ) return ret
set the all the workers in lbn to recover and activate them if they are not cli examples: .