BUGFIX: Disable mib resync and mds check allowing onu disable/enable to work

For certain onu there is always a mib mismatch (MDS value) between whats stored
in the mib db and whats configured on the onu.  This results in numerous
reattempts at resyncing the mib.  In cases were Volatile mib storage is
used this also prevent an onu from being re-enabled.

Long term need to discover why certain onu me, namely vlan_tagging_operation_table
cannot be synced properly.

Change-Id: I8e324cec7540a9a4e12b0cb18b28f93e317f8d65
diff --git a/voltha/adapters/brcm_openomci_onu/brcm_openomci_onu.py b/voltha/adapters/brcm_openomci_onu/brcm_openomci_onu.py
index 6791ce4..ad89dc8 100644
--- a/voltha/adapters/brcm_openomci_onu/brcm_openomci_onu.py
+++ b/voltha/adapters/brcm_openomci_onu/brcm_openomci_onu.py
@@ -75,6 +75,7 @@
         # Customize OpenOMCI for Broadcom ONUs
         self.broadcom_omci = deepcopy(OpenOmciAgentDefaults)
 
+        self.broadcom_omci['mib-synchronizer']['state-machine'] = BrcmMibSynchronizer
         self.broadcom_omci['omci-capabilities']['tasks']['get-capabilities'] = BrcmCapabilitiesTask
 
         # Defer creation of omci agent to a lazy init that allows subclasses to override support classes
diff --git a/voltha/adapters/brcm_openomci_onu/omci/brcm_mib_sync.py b/voltha/adapters/brcm_openomci_onu/omci/brcm_mib_sync.py
index f63c6a4..53ca22d 100644
--- a/voltha/adapters/brcm_openomci_onu/omci/brcm_mib_sync.py
+++ b/voltha/adapters/brcm_openomci_onu/omci/brcm_mib_sync.py
@@ -14,6 +14,7 @@
 # limitations under the License.
 
 import structlog
+from twisted.internet import reactor
 from voltha.extensions.omci.state_machines.mib_sync import MibSynchronizer
 
 log = structlog.get_logger()
@@ -22,10 +23,6 @@
     """
     OpenOMCI MIB Synchronizer state machine for Broadcom ONUs
     """
-    # broadcom takes a while to sync.  going too often causes errors
-    BRCM_RESYNC_DELAY = 300 # Periodically force a resync
-    BRCM_TIMEOUT_RETRY = 60
-    BRCM_AUDIT_DELAY = 0   # disable audit as if its out of sync nothing can fix it anyway
 
     def __init__(self, agent, device_id, mib_sync_tasks, db,
                  advertise_events=False):
@@ -42,26 +39,30 @@
         self.log.debug('function-entry')
 
         super(BrcmMibSynchronizer, self).__init__(agent, device_id, mib_sync_tasks, db,
-                                                  advertise_events=advertise_events,
-                                                  # states=MibSynchronizer.DEFAULT_STATES,
-                                                  # transitions=MibSynchronizer.DEFAULT_TRANSITIONS,
-                                                  # initial_state='disabled',
-                                                  timeout_delay=BrcmMibSynchronizer.BRCM_TIMEOUT_RETRY,
-                                                  audit_delay=BrcmMibSynchronizer.BRCM_AUDIT_DELAY,
-                                                  resync_delay=BrcmMibSynchronizer.BRCM_RESYNC_DELAY)
-        self._omci_managed = False      # TODO: Look up model number/check handler
+                                                  advertise_events=advertise_events)
 
     def on_enter_auditing(self):
         """
-        Perform a MIB Audit.  If our last MIB resync was too long in the
-        past, perform a resynchronization anyway
+        Perform a MIB Audit.  Currently this is broken on BRCM based onu and its never in sync and continuously
+        retries. On disable/enable it never enables becaues its never in sync.  Effectively disable the function so
+        disable/enable works and we can figure out whats going on
+
+        Oddly enough this is only an issue with MibVolatileDict
         """
-        self.log.debug('function-entry')
+        # TODO: Actually fix resync
+        self.log.warn('audit-resync-not-supported')
 
-        # TODO: currently the audit/resync state machine cannot reconcile and re-add differences causing
-        # it to loop forever
-        self.log.info('audit-resync-not-supported')
+        self._deferred = reactor.callLater(0, self.success)
 
-        if self._omci_managed:
-            super(BrcmMibSynchronizer, self).on_enter_auditing()
+    def on_enter_examining_mds(self):
+        """
+        Examine MIB difference counter between onu and voltha.  Currently same problem as on_enter_auditing.
+        examine mds is always mismatched and causing disable/enable to fail
+
+        Oddly enough this is only an issue with MibVolatileDict
+        """
+        # TODO: Actually fix resync
+        self.log.warn('examine-mds-resync-not-supported')
+
+        self._deferred = reactor.callLater(0, self.success)