ClusterSpec clusterSpec, String[] instances, String[] roles,
String fileName) throws Exception {
ClusterController controller = createClusterController(clusterSpec.getServiceName());
Predicate<NodeMetadata> condition = buildFilterPredicate(instances, roles, clusterSpec);
return handleScriptOutput(out, err, controller.runScriptOnNodesMatching(
clusterSpec, condition, execFile(fileName)));
}
private Predicate<NodeMetadata> buildFilterPredicate(String[] ids, String[] roles, ClusterSpec spec)
throws IOException {