> @@ -43,7 +43,14 @@
>           public RegionAndName apply(Image from) {
>              checkState(from.getLocation() != null,
>                       "in ec2, image locations cannot be null; typically, 
> they are Region-scoped");
> -            return new RegionAndName(from.getLocation().getId(), 
> from.getProviderId());
> +            String[] segments = from.getId().split("/");
> +            if (segments.length == 2) {
> +               return new RegionAndName(segments[0], segments[1]);
> +            } else {
> +               // for testing -- 
> EC2TemplateBuilderImplTest.testMatchesHardware* (and others?) set mock IDs 
> +               // which don't include location

agree

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/732/files#r28867113

Reply via email to