VOL-2171: Lock ont-g/ani only after all pptp/veip are locked

Also yield so the locking activity finishes before the
callbacks are called, so the MDS increment for the set
can be recorded in openomci

Ultimately this all prevents the MDS from getting out of sync
when disable is called and the locking is *halfway* done and
the omci state machine is prematurely stopped, causing some set responses
to be missed. which cases the MDS increment to be off.

This then later causes during an enable a forced reconcile when
we dont need it.  Having the MDS properly match speeds up re-enable.

Also remove custom get_mds_task thats not been used in quite some time.

Change-Id: Idfe295a61e8fc2810e8f0c956c5997c7a26b32ab
diff --git a/python/adapters/brcm_openomci_onu/omci/brcm_uni_lock_task.py b/python/adapters/brcm_openomci_onu/omci/brcm_uni_lock_task.py
index f062075..cbe22fa 100644
--- a/python/adapters/brcm_openomci_onu/omci/brcm_uni_lock_task.py
+++ b/python/adapters/brcm_openomci_onu/omci/brcm_uni_lock_task.py
@@ -84,6 +84,21 @@
             state = 1 if self._lock else 0
 
             # lock the whole ont and all the pptp.  some onu dont causing odd behavior.
+            pptp_list = sorted(self._config.pptp_entities) if self._config.pptp_entities else []
+            veip_list = sorted(self._config.veip_entities) if self._config.veip_entities else []
+
+            for entity_id in pptp_list:
+                pptp_value = self._config.pptp_entities[entity_id]
+                msg = PptpEthernetUniFrame(entity_id,
+                                           attributes=dict(administrative_state=state))
+                yield self._send_uni_lock_msg(entity_id, pptp_value, msg)
+
+            for entity_id in veip_list:
+                veip_value = self._config.veip_entities[entity_id]
+                msg = VeipUniFrame(entity_id,
+                                           attributes=dict(administrative_state=state))
+                yield self._send_uni_lock_msg(entity_id, veip_value, msg)
+
             msg = OntGFrame(attributes={'administrative_state': state})
             frame = msg.set()
             self.log.debug('openomci-msg', omci_msg=msg)
@@ -99,21 +114,6 @@
             else:
                 self.log.warn('cannot-set-lock-ontg', lock=self._lock)
 
-            pptp_list = sorted(self._config.pptp_entities) if self._config.pptp_entities else []
-            veip_list = sorted(self._config.veip_entities) if self._config.veip_entities else []
-
-            for entity_id in pptp_list:
-                pptp_value = self._config.pptp_entities[entity_id]
-                msg = PptpEthernetUniFrame(entity_id,
-                                           attributes=dict(administrative_state=state))
-                self._send_uni_lock_msg(entity_id, pptp_value, msg)
-
-            for entity_id in veip_list:
-                veip_value = self._config.veip_entities[entity_id]
-                msg = VeipUniFrame(entity_id,
-                                           attributes=dict(administrative_state=state))
-                self._send_uni_lock_msg(entity_id, veip_value, msg)
-
             self.deferred.callback(self)
 
         except Exception as e: