Skip to content

Commit 5b8d72b

Browse files
author
sateesh
committed
CS-16330 VM deployment not working and Exception on SSVM
status CS-16330: resolved fixed reviewed-by: Kelven
1 parent fab0ff7 commit 5b8d72b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

core/src/com/cloud/storage/resource/VmwareSecondaryStorageContextFactory.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
package com.cloud.storage.resource;
1414

1515
import java.util.HashMap;
16+
import java.util.Iterator;
1617
import java.util.Map;
1718

1819
import com.cloud.hypervisor.vmware.util.VmwareContext;
@@ -56,10 +57,11 @@ public static VmwareContext create(String vCenterAddress, String vCenterUserName
5657

5758
public static void invalidate(VmwareContext context) {
5859
synchronized(s_contextMap) {
59-
for(Map.Entry<String, VmwareContext> entry : s_contextMap.entrySet()) {
60-
if(entry.getValue() == context) {
61-
s_contextMap.remove(entry.getKey());
62-
}
60+
for(Iterator<Map.Entry<String, VmwareContext>> entryIter = s_contextMap.entrySet().iterator(); entryIter.hasNext();) {
61+
Map.Entry<String, VmwareContext> entry = entryIter.next();
62+
if(entry.getValue() == context) {
63+
entryIter.remove();
64+
}
6365
}
6466
}
6567

0 commit comments

Comments
 (0)