Remove flows from onu device on onu disable
Change-Id: I70f0d2835e84b5c19633ec1bd5108de48a040a3e
diff --git a/voltha/core/device_agent.py b/voltha/core/device_agent.py
index 2eca638..25eda22 100644
--- a/voltha/core/device_agent.py
+++ b/voltha/core/device_agent.py
@@ -374,7 +374,13 @@
self.log.debug('disable-device', device=device, dry_run=dry_run)
if not dry_run:
# Remove all flows before disabling device
- # self._delete_all_flows()
+ # Only do this for ONUs. ponsim seems to want the flows
+ # to be removed on onu disable and it does not seem to
+ # hurt the real devices. Flows on OLT are not removed when
+ # OLT is disabled - each adapter may do its own thing
+ # for disable -e.g. OpenOLT disables the NNI interface.
+ if not device.root:
+ self._delete_all_flows()
yield self.adapter_agent.disable_device(device)
except Exception, e:
self.log.exception('error', e=e)