jclouds/jclouds — pull request #362 by nacx (2014-05-12 15:27:06+00:00)
Title: JCLOUDS-517: New ElasticHosts images and regions

This PR is a follow-up for https://github.com/jclouds/jclouds/pull/331 and adds all fixed and suggested improvements. /cc @demobox @AudriusButkevicius

TL;DR: ElasticHosts providers use an API call to get the list of images except ServerLove, which runs an old api, that still hardcodes it. Also added the ElasticHosts providers for the missing regions.

---

Added the new ElasticHosts regions.

Updated the ElasticStack api to get the list of standard drives using an API call. All providers except ServerLove support the new API call, so the old logic in the ElasticStack api has been moved to that provider. The rest of providers will now extract all the OperatingSystem information by parsing the name of the StandardDrive.

A unit test has been added to the ElasticStack api with all the images that were hardcoded, to make sure all names are still parsed as expected and all information in the existing providers is kept.

Modified the default template for all ElasticHosts providers to match newer Ubuntu images and updated the Template*Live tests accordingly.

Also refactored the WellKnownImage map to a supplier to lazy load it when needed and avoid unexpected errors when building the Guice injector if there are authentication errors or similar.

Live test output for `elastichosts-lon-b` (all passing! ^^):

```bash
Tests run: 150, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 35:57 min (Wall Clock)
[INFO] Finished at: 2014-05-12T17:05:51+01:00
[INFO] Final Memory: 33M/661M
[INFO] ------------------------------------------------------------------------
```