jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zack Shoylev <notificati...@github.com>
Subject Re: [jclouds] fix jclouds live tests failing when a keypair is missing (#667)
Date Thu, 05 Feb 2015 19:59:39 GMT
> @@ -62,7 +64,18 @@
>     public static void checkSecretKeyFile(String secretKeyFile) {
>        checkNotNull(emptyToNull(secretKeyFile), "System property: [test.ssh.keyfile]
set to an empty string");
>        if (!new File(secretKeyFile).exists()) {
> -         throw new IllegalStateException("secretKeyFile not found at: " + secretKeyFile);
> +         // Create file if missing
> +         try {
> +            JSch jsch = new JSch();
> +            KeyPair kPair = KeyPair.genKeyPair(jsch, KeyPair.RSA, 4096);
> +            kPair.writePrivateKey(secretKeyFile);
> +            kPair.writePublicKey(secretKeyFile + ".pub", "jclouds generated key pair");
> +            kPair.dispose();

I notice we generate a 2048 key... Any issues upping that to 4k?
Also, yes, great point - it's possible to pass the keypair directly, but I am not sure the
files are used after during testing or not. Still checking.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/667/files#r24193992
Mime
View raw message