def execute_method(execution_object, method_name, *args, **kwargs):

    #First look to see if this is a remote method
    if method_name.find('.') > 0:

        service_client, operation = get_remote_info(execution_object, method_name)

        methodToCall = getattr(service_client, operation)
        param_dict = get_method_arguments(service_client, operation, **kwargs)
        ret = methodToCall(*args, **param_dict )
        return ret

    else:
        #For local methods, first look for the method in the current class
        func = getattr(execution_object, method_name, None)
        if func:
            param_dict = get_method_arguments(execution_object, method_name, **kwargs)
            return func(*args, **param_dict)
        elif getattr(execution_object, 'service_provider', None) is not None:
            #Next look to see if the method exists in the service provider process
            func = getattr(execution_object.service_provider, method_name, None)
            if func:
                param_dict = get_method_arguments(execution_object.service_provider,method_name, **kwargs)
                return func(*args, **param_dict)

    return None
Waits until all workers are in RUNNING status.
dataset/ETHPy150Open ooici/pyon/pyon/util/execute.py/execute_method--crossover with--dataset/ETHPy150Open GoogleCloudPlatform/solutions-google-compute-engine-cluster-for-hadoop/gce_cluster.py/GceCluster._WaitForWorkersReady