Skip to content

Instantly share code, notes, and snippets.

@zack-shoylev
Last active December 22, 2015 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zack-shoylev/6518025 to your computer and use it in GitHub Desktop.
Save zack-shoylev/6518025 to your computer and use it in GitHub Desktop.
Print the results
try {
String provider = compute.getContext().toString().contains("rackspace") ?
"Rackspace CloudServers" : "Openstack Nova";
System.out.println("Provider: " + provider);
System.out.println("Credentials: " + node.getCredentials());
if (node.getCredentials().getOptionalPrivateKey().isPresent()) {
System.out.println(" Login: ssh -i jclouds.pem " + node.getCredentials().getUser() + "@" + address);
}
else {
System.out.println(" Login: ssh " + node.getCredentials().getUser() + "@" + address);
System.out.println(" Password: " + node.getCredentials().getPassword());
}
if(!"demo:demo".equals(user)) {
System.out.println(" Go to http://" + address);
}
}
catch (Throwable e) {
e.printStackTrace();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment