> + cleanupOrphanedKeyPairsInZone(groups, zoneId);
> + }
> +
> + private void cleanupOrphanedSecurityGroupsInZone(Set<String> groups,
> String zoneId) {
> + Zone zone = zoneIdToZone.get().getUnchecked(zoneId);
> +
> + if (supportsSecurityGroups().apply(zone)) {
> + for (String group : groups) {
> + for (SecurityGroup securityGroup :
> Iterables.filter(client.getSecurityGroupClient().listSecurityGroups(),
> +
> SecurityGroupPredicates.nameMatches(namingConvention.create().containsGroup(group))))
> {
> + ZoneAndName zoneAndName = ZoneAndName.fromZoneAndName(zoneId,
> securityGroup.getName());
> + logger.debug(">> deleting securityGroup(%s)", zoneAndName);
> +
> client.getSecurityGroupClient().deleteSecurityGroup(securityGroup.getId());
> + // TODO: test this clear happens
> + securityGroupMap.invalidate(zoneAndName);
> + logger.debug("<< deleted securityGroup(%s)", zoneAndName);
I'll toss in a new log line and move the second existing one.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/45/files#r4843071