danielestevez commented on this pull request.


> @@ -110,6 +122,27 @@ protected VirtualMachineInStatePredicateFactory 
> provideNodeSuspendedPredicate(fi
             timeouts.nodeTerminated, pollPeriod.pollInitialPeriod, 
pollPeriod.pollMaxPeriod);
    }
 
+   @Provides
+   @Named(TIMEOUT_RESOURCE_REMOVED)
+   protected Predicate<IdReference> provideResourceRemovedPredicate(final 
AzureComputeApi api, final ComputeServiceConstants.Timeouts timeouts,
+         final PollPeriod pollPeriod) {
+      long timeout = timeouts.nodeTerminated;
+      return retry(new Predicate<IdReference>() {
+         @Override
+         public boolean apply(final IdReference input) {
+            List<org.jclouds.azurecompute.arm.domain.Resource> 
attachedResources = api.getResourceGroupApi().resources(input.resourceGroup());
+            Optional<org.jclouds.azurecompute.arm.domain.Resource> 
resourceInGroup = Iterables.tryFind(attachedResources, new 
Predicate<org.jclouds.azurecompute.arm.domain.Resource>() {
+               @Override
+               public boolean 
apply(org.jclouds.azurecompute.arm.domain.Resource resource) {
+                  return resource.id().equalsIgnoreCase(input.id());

We should expect different cases.... everywhere :( Azure ARM is case 
insensitive and our provider should adapt to this. 
There are currently lots of places where this could fail since we use equals or 
Map keys.
I had this trouble here: 
https://stackoverflow.com/questions/50068324/azure-arm-api-returns-locations-with-inconsistent-case/50977265#50977265
 and it seems to happen to others too 
https://stackoverflow.com/questions/48561304/resource-group-name-case-insensitive-in-disk-ids
So in short, yes, we should always use equalsIgnoreCase for safety

-- 
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/pull/1240#discussion_r220581590

Reply via email to