> @@ -57,15 +58,30 @@ public void testCreateAndDeleteKeyPair() throws Exception
> {
> }
>
> public void testCreateAndDeleteKeyPairWithPublicKey() throws Exception {
> - final String KEYPAIR_NAME = "testkp";
> - final String PUBLIC_KEY = "ssh-rsa
> AAAAB3NzaC1yc2EAAAADAQABAAAAgQCrrBREFxz3002l1HuXz0+UOdJQ/mOYD5DiJwwB/TOybwIKQJPOxJWA9gBoo4k9dthTKBTaEYbzrll7iZcp59E80S6mNiAr3mUgi+x5Y8uyXeJ2Ws+h6peVyFVUu9epkwpcTd1GVfdcVWsTajwDz9+lxCDhl0RZKDFoT0scTxbj/w==
> nova@nv-aw2az2-api0002";
> + for (String zoneId : api.getConfiguredZones()) {
> + KeyPairApi keyPairApi =
> api.getKeyPairExtensionForZone(zoneId).get();
> + KeyPair keyPair = null;
> + try {
> + keyPair = keyPairApi.createWithPublicKey(KEYPAIR_NAME,
> PUBLIC_KEY);
> + assertNotNull(keyPair);
> + } finally {
> + if (keyPair != null) {
> + keyPairApi.delete(KEYPAIR_NAME);
Ah, interesting...delete would fail if a key with `KEYPAIR_NAME` did not exist?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/391/files#r13473377