> +         logger.debug("Generating windows key for instance %s, by updating 
> metadata", instance.get().name());
> +         final InstanceApi instanceApi = api.instancesInZone(zone);
> +         Metadata metadata = instance.get().metadata();
> +         // If disableHtmlEscaping is not there, == will be escaped from 
> modulus value
> +          metadata.put("windows-keys", new 
> GsonBuilder().disableHtmlEscaping().create().toJson(extractKeyMetadata(keys)));
> +
> +         AtomicReference<Operation> operation = 
> Atomics.newReference(instanceApi.setMetadata(instance.get().name(), 
> metadata));
> +         operationDone.apply(operation);
> +
> +         if (operation.get().httpErrorStatusCode() != null) {
> +            logger.warn("Generating windows key for %s failed. Http Error 
> Code: %d HttpError: %s",
> +                  operation.get().targetId(), 
> operation.get().httpErrorStatusCode(),
> +                  operation.get().httpErrorMessage());
> +         }
> +
> +         TimeLimiter limiter = new SimpleTimeLimiter();

The pattern is a little different here.
My aim is not to verify uncertain predicate or or verify reach-ability.
I just want to return on first success.

---
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-google/pull/170/files/172e50d1a163c5ba80ed638cf9c7b25982ca204c#r58855971

Reply via email to