ONOS-2381 Fixing intent purge command

We need to remove the current value.

Change-Id: Ib15f9b097e3df096b45367012d067973436e1d85
This commit is contained in:
Brian O'Connor 2015-07-16 11:44:03 -07:00 committed by Gerrit Code Review
parent 8040176c31
commit 597934f755
2 changed files with 2 additions and 1 deletions

View File

@ -281,6 +281,7 @@ public class IntentData { //FIXME need to make this "immutable"
return true;
case PURGE_REQ:
// TODO we should enforce that only WITHDRAWN intents can be purged
return true;
case COMPILING:

View File

@ -180,7 +180,7 @@ public class GossipIntentStore
// Only the master is modifying the current state. Therefore assume
// this always succeeds
if (newData.state() == PURGE_REQ) {
currentMap.remove(newData.key(), newData);
currentMap.remove(newData.key(), currentData);
} else {
currentMap.put(newData.key(), new IntentData(newData));
}