> +         sgApi.get().delete(groupId);
> +         // TODO: test this clear happens
> +         groupCreator.invalidate(new ZoneSecurityGroupNameAndPorts(zone, 
> groupId, ImmutableSet.<Integer> of()));
> +         return true;
> +      }
> +
> +      return false;
> +   }
> +
> +
> +   @Override
> +   public SecurityGroup addIpPermission(IpPermission ipPermission, 
> SecurityGroup group) {
> +      String zone = group.getLocation().getId();
> +      String id = group.getId();
> +
> +      Optional<? extends SecurityGroupApi> sgApi = 
> client.getSecurityGroupExtensionForZone(zone);

The only way it could end up null is if you pass a SecurityGroup created from 
another cloud than Nova - any Nova-created SG is gonna have the zone set up.

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

Reply via email to