> +      if (api.getNetworkApiForProject(userProject.get()).get(id) == null) {
> +         return false;
> +      }
> +
> +      ListOptions options = new ListOptions.Builder().filter("network eq 
> .*/" + id);
> +
> +      FluentIterable<Firewall> fws = 
> api.getFirewallApiForProject(userProject.get()).list(options).concat();
> +
> +      for (Firewall fw : fws) {
> +         AtomicReference<Operation> operation = new 
> AtomicReference<Operation>(api.getFirewallApiForProject(userProject.get())
> +                 .delete(fw.getName()));
> +
> +         retry(operationDonePredicate, operationCompleteCheckTimeout, 
> operationCompleteCheckInterval,
> +                 MILLISECONDS).apply(operation);
> +
> +         checkState(!operation.get().getHttpError().isPresent(), "Could not 
> delete firewall, operation failed" + operation);

I think it's probably OK to stop deleting if something 'splodes here...as to 
the exception, I don't know what the right one would be, but 
IllegalStateException seems as good as any - that's what we're using for 
firewall/network creation in the first place.

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

Reply via email to