}
@Override
protected void beforeConfigure(ClusterActionEvent event) throws IOException, InterruptedException {
ClusterSpec clusterSpec = event.getClusterSpec();
Cluster cluster = event.getCluster();
LOG.info("Authorizing firewall");
ComputeServiceContext computeServiceContext =
ComputeServiceContextBuilder.build(clusterSpec);
FirewallSettings.authorizeIngress(computeServiceContext,
cluster.getInstances(), clusterSpec, CLIENT_PORT);
// Pass list of all servers in ensemble to configure script.
// Position is significant: i-th server has id i.
String servers = Joiner.on(' ').join(getPrivateIps(cluster.getInstancesMatching(
RolePredicates.role(ZooKeeperClusterActionHandler.ZOOKEEPER_ROLE))));
addStatement(event, call("configure_zookeeper", "-c",
clusterSpec.getProvider(), servers));
}