>        for (Integer port : templateOptions.getInboundPorts()) {
> -         tcpRule.addPort(port);
> -         udpRule.addPort(port);
> +         String name = naming.name(port);
> +         ImmutableSet<Firewall.Rule> rules = 
> ImmutableSet.of(Firewall.Rule.permitTcpRule(port), 
> Firewall.Rule.permitUdpRule(port));
> +         FirewallOptions firewallOptions = new FirewallOptions()
> +                 .name(name)
> +                 .network(network.getSelfLink())
> +                 .allowedRules(rules)
> +                 .sourceTags(templateOptions.getTags())
> +                 .sourceRanges(of(DEFAULT_INTERNAL_NETWORK_RANGE, 
> EXTERIOR_RANGE))
> +                 .targetTags(ImmutableSet.of(name));
> +
> +         Firewall firewall = 
> api.getFirewallApiForProject(projectName).get(firewallOptions.getName());

Extract `api.getFirewallApiForProject(projectName)` as variable?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/33/files#r7512769

Reply via email to