You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jclouds.apache.org by an...@apache.org on 2014/06/09 16:09:53 UTC

[2/2] git commit: Small improvements to the CreateServer GCE example.

Small improvements to the CreateServer GCE example.


Project: http://git-wip-us.apache.org/repos/asf/jclouds-examples/repo
Commit: http://git-wip-us.apache.org/repos/asf/jclouds-examples/commit/fb328b5a
Tree: http://git-wip-us.apache.org/repos/asf/jclouds-examples/tree/fb328b5a
Diff: http://git-wip-us.apache.org/repos/asf/jclouds-examples/diff/fb328b5a

Branch: refs/heads/master
Commit: fb328b5a84040563ab0a76c29e6891cbec00c0a2
Parents: 070e999
Author: MikoĊ‚aj Zalewski <mi...@google.com>
Authored: Fri May 9 13:30:14 2014 +0200
Committer: Andrew Phillips <an...@apache.org>
Committed: Mon Jun 9 10:09:33 2014 -0400

----------------------------------------------------------------------
 .../examples/google/computeengine/CreateServer.java       | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jclouds-examples/blob/fb328b5a/google/src/main/java/org/jclouds/examples/google/computeengine/CreateServer.java
----------------------------------------------------------------------
diff --git a/google/src/main/java/org/jclouds/examples/google/computeengine/CreateServer.java b/google/src/main/java/org/jclouds/examples/google/computeengine/CreateServer.java
index 335a0e5..66cb9bd 100644
--- a/google/src/main/java/org/jclouds/examples/google/computeengine/CreateServer.java
+++ b/google/src/main/java/org/jclouds/examples/google/computeengine/CreateServer.java
@@ -134,7 +134,7 @@ public class CreateServer implements Closeable {
       Set<? extends Hardware> profiles = computeService.listHardwareProfiles();
       Hardware result = null;
 
-      for (Hardware profile: profiles) {
+      for (Hardware profile : profiles) {
          System.out.format("    %s%n", profile);
          if (profile.getId().equals(ZONE + "/f1-micro")) {
             result = profile;
@@ -142,8 +142,9 @@ public class CreateServer implements Closeable {
       }
 
       if (result == null) {
-         System.err.println("f1-micro flavor not found. Using first flavor found.%n");
+         System.err.println("f1-micro flavor not found. Using first flavor found:");
          result = profiles.iterator().next();
+         System.err.format("-> %s%n", result);
       }
       return result;
    }
@@ -159,7 +160,7 @@ public class CreateServer implements Closeable {
       Set<? extends Image> images = computeService.listImages();
       Image result = null;
 
-      for (Image image: images) {
+      for (Image image : images) {
          System.out.format("    %s%n", image);
          if (image.getOperatingSystem().getVersion().equals("debian.7.wheezy")) {
             result = image;
@@ -167,8 +168,9 @@ public class CreateServer implements Closeable {
       }
 
       if (result == null) {
-         System.err.println("Image with Debian Wheezy operating system not found. Using first image found.%n");
+         System.err.println("Image with Debian Wheezy operating system not found. Using first image found:");
          result = images.iterator().next();
+         System.err.format("-> %s%n", result);
       }
 
       return result;