log more details when creating keys

This commit is contained in:
Adrian Cole 2011-10-13 02:09:13 -07:00
parent c28a2e38c3
commit 7278582730
1 changed files with 2 additions and 2 deletions

View File

@ -69,12 +69,12 @@ public class ImportOrReturnExistingKeypair implements Function<RegionNameAndPubl
try {
keyPair = ec2Client.getKeyPairServices().importKeyPairInRegion(region, "jclouds#" + group,
publicKeyMaterial);
logger.debug("<< imported keyPair(%s) fingerprint(%s)", keyPair.getKeyName(), keyPair.getKeyFingerprint());
logger.debug("<< imported keyPair(%s)", keyPair);
} catch (IllegalStateException e) {
keyPair = Iterables.getFirst(
ec2Client.getKeyPairServices().describeKeyPairsInRegion(region, "jclouds#" + group), null);
if (keyPair != null)
logger.debug("<< retrieved existing keyPair(%s) fingerprint(%s)", keyPair.getKeyName(), keyPair.getKeyFingerprint());
logger.debug("<< retrieved existing keyPair(%s)", keyPair);
}
return keyPair;
}