mirror of https://github.com/apache/jclouds.git
CloudStack image location is Zone, and the part of the zone is the provider location
This commit is contained in:
parent
e4197bec8f
commit
c377c6da01
|
@ -62,9 +62,11 @@ public class LocationPredicate implements Predicate<ComputeMetadata> {
|
|||
"only locations of scope PROVIDER can have a null parent; input: %s",
|
||||
input.getLocation());
|
||||
|
||||
return location.equals(input.getLocation()) || location.getParent() != null
|
||||
&& location.getParent().equals(input.getLocation()) || location.getParent().getParent() != null
|
||||
&& location.getParent().getParent().equals(input.getLocation());
|
||||
return location.equals(input.getLocation()) ||
|
||||
(input.getLocation().getParent() != null && location.equals(input.getLocation().getParent())) ||
|
||||
(location.getParent() != null && location.getParent().equals(input.getLocation())) ||
|
||||
(location.getParent() != null && location.getParent().getParent() != null &&
|
||||
location.getParent().getParent().equals(input.getLocation()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -614,7 +614,7 @@ public class TemplateBuilderImpl implements TemplateBuilder {
|
|||
location = defaultLocation.get();
|
||||
|
||||
Predicate<Image> imagePredicate = buildImagePredicate();
|
||||
Iterable<? extends Image> supportedImages = filter(images, buildImagePredicate());
|
||||
Iterable<? extends Image> supportedImages = filter(images, imagePredicate);
|
||||
if (size(supportedImages) == 0) {
|
||||
if (imagePredicate == idPredicate) {
|
||||
throw new NoSuchElementException(format("%s not found", idPredicate));
|
||||
|
|
Loading…
Reference in New Issue