> +   private void cleanupOrphanedKeyPairsInZone(Set<String> groups, String 
> zoneId) {
> +      for (String group : groups) {
> +         for (SshKeyPair pair : 
> Iterables.filter(client.getSSHKeyPairClient().listSSHKeyPairs(),
> +                                                 
> nameMatches(namingConvention.create().containsGroup(group)))) {
> +            logger.debug(">> deleting keypair(%s)", pair.getName());
> +            client.getSSHKeyPairClient().deleteSSHKeyPair(pair.getName());
> +            // TODO: test this clear happens
> +            keyPairCache.invalidate(pair.getName());
> +            logger.debug("<< deleted keypair(%s)", pair.getName());
> +         }
> +         
> keyPairCache.invalidate(namingConvention.create().sharedNameForGroup(group));
> +      }
> +   }
> +
> +   /**
> +    * returns template options, except of type {@link 
> CloudStackTemplateOptions}.

Yeah, ugly copy and paste

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

Reply via email to