jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Svet <notificati...@github.com>
Subject Re: [jclouds/jclouds-labs] Vagrant provider (#160)
Date Wed, 28 Dec 2016 19:27:28 GMT
neykov commented on this pull request.



> +      String privateKey;
+      try {
+         privateKey = Files.toString(new File(sshConfig.getIdentityFile()), Charset.defaultCharset());
+      } catch (IOException e) {
+         throw new IllegalStateException("Invalid private key " + sshConfig.getIdentityFile(),
e);
+      }
+
+      LoginCredentials loginCredentials = LoginCredentials.builder()
+            .user(sshConfig.getUser())
+            .privateKey(privateKey)
+            .build();
+      return new NodeAndInitialCredentials<VagrantNode>(node, newMachine.getId(), loginCredentials);
+   }
+
+   private Collection<String> getNetworks(String name, VagrantApi vagrant) {
+       String networks = vagrant.ssh(name, "ip address show | grep 'scope global'");

CentOS 7 doesn't have `ifconfig` installed. All of the images I've used so far have `ip`.
I've added a comment to explain the choice. In future could add a fallback to `ifconfig` if
needed.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/160
Mime
View raw message