> + private void executeSimpleCommand(
> + final NodeMetadata instance, final String googleUserName, final
> String sshPrivateKey) {
> + Statement script = Statements.exec("ls -l /");
> +
> + // Set up credentials.
> + RunScriptOptions options = overrideLoginCredentials((new
> LoginCredentials.Builder())
> + .user(googleUserName)
> + .privateKey(sshPrivateKey)
> + .build())
> + .blockOnComplete(true)
> + .runAsRoot(false);
> +
> + ExecResponse response =
> computeService.runScriptOnNode(instance.getId(), script, options);
> +
> + if (response.getExitStatus() == 0) {
> + System.out.format("Exit Status:%n============%n%s%n%n",
> response.getExitStatus());
Also print the exit status if non-zero?
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/56/files#r15661978