[ 3289 ] remove debugging statements
This commit consists of:
1) Change the flow match method in ponsim to handle multiple matches
2) Add logical PORT change callback
3) Clear all flows on a device when the device is disabled
Change-Id: I82ddc9c4555dced917dee8f13d7d4f08ca4e1d03
diff --git a/voltha/core/device_agent.py b/voltha/core/device_agent.py
index 3c2e267..b1cf67b 100644
--- a/voltha/core/device_agent.py
+++ b/voltha/core/device_agent.py
@@ -25,7 +25,7 @@
from voltha.core.config.config_proxy import CallbackType
from voltha.protos.common_pb2 import AdminState, OperStatus
from voltha.registry import registry
-
+from voltha.protos.openflow_13_pb2 import Flows, FlowGroups
class InvalidStateTransition(Exception): pass
@@ -183,10 +183,20 @@
self.log.info('abandon-device', device=device, dry_run=dry_run)
raise NotImplementedError()
+ def _delete_all_flows(self):
+ """ Delete all flows on the device """
+ try:
+ self.flows_proxy.update('/', Flows(items=[]))
+ self.groups_proxy.update('/', FlowGroups(items=[]))
+ except Exception, e:
+ self.exception('flow-delete-exception', e=e)
+
@inlineCallbacks
def _disable_device(self, device, dry_run=False):
self.log.info('disable-device', device=device, dry_run=dry_run)
if not dry_run:
+ # Remove all flows before disabling device
+ self._delete_all_flows()
yield self.adapter_agent.disable_device(device)
@inlineCallbacks