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; return true;
case PURGE_REQ: case PURGE_REQ:
// TODO we should enforce that only WITHDRAWN intents can be purged
return true; return true;
case COMPILING: case COMPILING:

View File

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