To be honest, the first reason was that the Rackspace example does it.
However, it also has the advantage that even when GCE will stop providing
f1-micro instances one day, the example will still work.


On Mon, Apr 28, 2014 at 3:12 AM, Andrew Phillips
<notifications@github.com>wrote:

> In
> google/src/main/java/org/jclouds/examples/google/computeengine/CreateServer.java:
>
> > +   private Hardware getHardware() {
> > +      System.out.format("  Hardware Profiles%n");
> > +
> > +      Set<? extends Hardware> profiles = computeService.
> listHardwareProfiles();
> > +      Hardware result = null;
> > +
> > +      for (Hardware profile: profiles) {
> > +         System.out.format("    %s%n", profile);
> > +         if (profile.getId().equals(ZONE + "/f1-micro")) {
> > +            result = profile;
> > +         }
> > +      }
> > +
> > +      if (result == null) {
> > +         System.err.println("f1-micro flavor not found. Using first flavor found.%n");
> > +         result = profiles.iterator().next();
>
> Are we sure we want to do this? Why not simply fail instead?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/jclouds/jclouds-examples/pull/44/files#r12032766>
> .
>