CS-16330 VM deployment not working and Exception on SSVM

status CS-16330: resolved fixed
reviewed-by: Kelven
This commit is contained in:
sateesh 2012-09-24 16:54:10 +05:30
parent ec0c35269a
commit 97e043c65e
1 changed files with 6 additions and 4 deletions

View File

@ -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<String, VmwareContext> entry : s_contextMap.entrySet()) {
if(entry.getValue() == context) {
s_contextMap.remove(entry.getKey());
}
for(Iterator<Map.Entry<String, VmwareContext>> entryIter = s_contextMap.entrySet().iterator(); entryIter.hasNext();) {
Map.Entry<String, VmwareContext> entry = entryIter.next();
if(entry.getValue() == context) {
entryIter.remove();
}
}
}