From 97e043c65ef9510f0b389cf74b975c7dcbb9c286 Mon Sep 17 00:00:00 2001 From: sateesh Date: Mon, 24 Sep 2012 16:54:10 +0530 Subject: [PATCH] CS-16330 VM deployment not working and Exception on SSVM status CS-16330: resolved fixed reviewed-by: Kelven --- .../resource/VmwareSecondaryStorageContextFactory.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java b/core/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java index 4e69aadf615..d03f932e989 100644 --- a/core/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java +++ b/core/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java @@ -5,6 +5,7 @@ package com.cloud.storage.resource; import java.util.HashMap; +import java.util.Iterator; import java.util.Map; import com.cloud.hypervisor.vmware.util.VmwareContext; @@ -48,10 +49,11 @@ public class VmwareSecondaryStorageContextFactory { public static void invalidate(VmwareContext context) { synchronized(s_contextMap) { - for(Map.Entry entry : s_contextMap.entrySet()) { - if(entry.getValue() == context) { - s_contextMap.remove(entry.getKey()); - } + for(Iterator> entryIter = s_contextMap.entrySet().iterator(); entryIter.hasNext();) { + Map.Entry entry = entryIter.next(); + if(entry.getValue() == context) { + entryIter.remove(); + } } }