VOL-1132 Use base MIB synchronizer class

Now that mib sync and reconcilition is available in the library
revert back to using base class implementation.

Also persist omci mib storage rather than using volatile (in memory) storage
Given mib resync works onu and omci state machine restarts are much faster.
BUT the initial mib download will take MUCH longer depending on the speed of your etcd
and its backing disks.  Up to 2 minutes could be expected.  A side effect of
storing the mib will be that show_mib now works, which is useful for troubleshooting.

Also remove inlinecallbacks for functions that no longer yield.

Change-Id: I3e86b8219d0a8552366e47b3ea87f6bbfeaaaf1e
diff --git a/voltha/adapters/brcm_openomci_onu/brcm_openomci_onu.py b/voltha/adapters/brcm_openomci_onu/brcm_openomci_onu.py
index c7fce17..565fa63 100644
--- a/voltha/adapters/brcm_openomci_onu/brcm_openomci_onu.py
+++ b/voltha/adapters/brcm_openomci_onu/brcm_openomci_onu.py
@@ -75,13 +75,9 @@
         # Customize OpenOMCI for Broadcom ONUs
         self.broadcom_omci = deepcopy(OpenOmciAgentDefaults)
 
-        self.broadcom_omci['mib-synchronizer']['state-machine'] = BrcmMibSynchronizer
-        self.broadcom_omci['mib-synchronizer']['database'] = MibDbVolatileDict
-        #self.broadcom_omci['mib-synchronizer']['tasks']['get-mds'] = BrcmGetMdsTask
-        #self.broadcom_omci['mib-synchronizer']['tasks']['mib-audit'] = BrcmGetMdsTask
         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
+        # Defer creation of omci agent to a lazy init that allows subclasses to override support classes
 
         # register for adapter messages
         self.adapter_agent.register_for_inter_adapter_messages()
diff --git a/voltha/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py b/voltha/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
index 146253d..94784ec 100644
--- a/voltha/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
+++ b/voltha/adapters/brcm_openomci_onu/brcm_openomci_onu_handler.py
@@ -294,7 +294,6 @@
 
     # Calling this assumes the onu is active/ready and had at least an initial mib downloaded.   This gets called from
     # flow decomposition that ultimately comes from onos
-    @inlineCallbacks
     def update_flow_table(self, device, flows):
         self.log.debug('function-entry', device=device, flows=flows)
         #
@@ -303,6 +302,13 @@
         #
         #self.log.info('bulk-flow-update', device_id=device.id, flows=flows)
 
+        # no point in pushing omci flows if the device isnt reachable
+        if device.connect_status != ConnectStatus.REACHABLE or \
+           device.admin_state != AdminState.ENABLED:
+            self.log.warn("device-disabled-or-offline-skipping-flow-update",
+                          admin=device.admin_state, connect=device.connect_status)
+            return
+
         def is_downstream(port):
             return port == self._pon_port_number
 
@@ -435,10 +441,10 @@
                 else:
                     self._add_vlan_filter_task(device, _set_vlan_vid)
 
-
             except Exception as e:
                 self.log.exception('failed-to-install-flow', e=e, flow=flow)
 
+
     def _add_vlan_filter_task(self, device, _set_vlan_vid):
         def success(_results):
             self.log.info('vlan-tagging-success', _results=_results)
@@ -533,7 +539,6 @@
 
 
     # Not currently called.  Would be called presumably from the olt handler
-    @inlineCallbacks
     def remove_gemport(self, data):
         self.log.debug('remove-gemport', data=data)
         gem_port = GemportsConfigData()
@@ -541,7 +546,7 @@
         device = self.adapter_agent.get_device(self.device_id)
         if device.connect_status != ConnectStatus.REACHABLE:
             self.log.error('device-unreachable')
-            returnValue(None)
+            return
 
         #TODO: Create a remove task that encompasses this
 
@@ -579,13 +584,12 @@
             self.log.info('received-null-tcont-data', tcont=tcont.alloc_id)
 
     # Not currently called.  Would be called presumably from the olt handler
-    @inlineCallbacks
     def remove_tcont(self, tcont_data, traffic_descriptor_data):
         self.log.debug('remove-tcont', tcont_data=tcont_data, traffic_descriptor_data=traffic_descriptor_data)
         device = self.adapter_agent.get_device(self.device_id)
         if device.connect_status != ConnectStatus.REACHABLE:
             self.log.error('device-unreachable')
-            returnValue(None)
+            return
 
         # TODO: Create some omci task that encompases this what intended
 
@@ -595,7 +599,6 @@
 
         # TODO: create objects and populate for later omci calls
 
-    @inlineCallbacks
     def disable(self, device):
         self.log.debug('function-entry', device=device)
         try:
@@ -617,7 +620,6 @@
         except Exception as e:
             log.exception('exception-in-onu-disable', exception=e)
 
-    @inlineCallbacks
     def reenable(self, device):
         self.log.debug('function-entry', device=device)
         try:
@@ -632,13 +634,12 @@
         except Exception as e:
             log.exception('exception-in-onu-reenable', exception=e)
 
-    @inlineCallbacks
     def reboot(self):
         self.log.info('reboot-device')
         device = self.adapter_agent.get_device(self.device_id)
         if device.connect_status != ConnectStatus.REACHABLE:
             self.log.error("device-unreachable")
-            returnValue(None)
+            return
 
         def success(_results):
             self.log.info('reboot-success', _results=_results)