VOL-1014 OpenOLT reconciliation

state machine and logical device reconciliation

Change-Id: I8bd155041f89658294fe4218213af34ae6112123
diff --git a/voltha/adapters/openolt/openolt_device.py b/voltha/adapters/openolt/openolt_device.py
index 3e06f00..97062a3 100644
--- a/voltha/adapters/openolt/openolt_device.py
+++ b/voltha/adapters/openolt/openolt_device.py
@@ -116,6 +116,10 @@
         self.heartbeat_signature = None
         self.heartbeat_thread.start()
 
+        if is_reconciliation:
+            # Put state machine in state up
+            reactor.callFromThread(self.olt_up, reconciliation=True)
+
         self.log.debug('openolt-device-created', device_id=self.device_id)
 
     def process_indications(self):
@@ -171,7 +175,9 @@
 
     def olt_indication_up(self, event):
         olt_indication = event.kwargs.get('ind', None)
-        self.log.debug("olt indication", olt_ind=olt_indication)
+        is_reconciliation = event.kwargs.get('reconciliation', False)
+        self.log.debug("olt indication", olt_ind=olt_indication,
+            reconciliation=is_reconciliation)
 
         device = self.adapter_agent.get_device(self.device_id)
 
@@ -200,6 +206,9 @@
         else:
             # logical device already exists
             self.logical_device_id = device.parent_id
+            if is_reconciliation:
+                self.adapter_agent.reconcile_logical_device(
+                    self.logical_device_id)
 
         # Update phys OF device
         device.parent_id = self.logical_device_id