Committed by
Gerrit Code Review
wipe-out command changes to purge intents
Change-Id: Ic440cbd1d9832b601b167f187497133fcbc4d97c
Showing
1 changed file
with
4 additions
and
1 deletions
... | @@ -24,6 +24,7 @@ import org.onosproject.net.device.DeviceAdminService; | ... | @@ -24,6 +24,7 @@ import org.onosproject.net.device.DeviceAdminService; |
24 | import org.onosproject.net.host.HostAdminService; | 24 | import org.onosproject.net.host.HostAdminService; |
25 | import org.onosproject.net.intent.Intent; | 25 | import org.onosproject.net.intent.Intent; |
26 | import org.onosproject.net.intent.IntentService; | 26 | import org.onosproject.net.intent.IntentService; |
27 | +import org.onosproject.net.intent.IntentState; | ||
27 | import org.onosproject.net.link.LinkAdminService; | 28 | import org.onosproject.net.link.LinkAdminService; |
28 | 29 | ||
29 | /** | 30 | /** |
... | @@ -86,7 +87,9 @@ public class WipeOutCommand extends ClustersListCommand { | ... | @@ -86,7 +87,9 @@ public class WipeOutCommand extends ClustersListCommand { |
86 | print("Wiping intents"); | 87 | print("Wiping intents"); |
87 | IntentService intentService = get(IntentService.class); | 88 | IntentService intentService = get(IntentService.class); |
88 | for (Intent intent : intentService.getIntents()) { | 89 | for (Intent intent : intentService.getIntents()) { |
89 | - intentService.withdraw(intent); | 90 | + if (intentService.getIntentState(intent.key()) != IntentState.WITHDRAWN) { |
91 | + intentService.withdraw(intent); | ||
92 | + } | ||
90 | intentService.purge(intent); | 93 | intentService.purge(intent); |
91 | } | 94 | } |
92 | } | 95 | } | ... | ... |
-
Please register or login to post a comment