diff --git a/voltha/adapters/openolt/openolt.py b/voltha/adapters/openolt/openolt.py
index 137096d..50c84af 100644
--- a/voltha/adapters/openolt/openolt.py
+++ b/voltha/adapters/openolt/openolt.py
@@ -51,6 +51,7 @@
     }
 }
 
+
 @implementer(IAdapterInterface)
 class OpenoltAdapter(object):
     name = 'openolt'
@@ -210,7 +211,7 @@
     def update_flows_bulk(self, device, flows, groups):
         log.info('bulk-flow-update', device_id=device.id,
                  number_of_flows=len(flows.items), number_of_groups=len(
-                groups.items))
+                     groups.items))
         log.debug('flows and grousp details', flows=flows, groups=groups)
         assert len(groups.items) == 0, "Cannot yet deal with groups"
         handler = self.devices[device.id]
@@ -227,7 +228,7 @@
                              groups, device_rules_map):
 
         log.info('logical-flows-update', flows_to_add=len(flows_to_add),
-                 flows_to_remove = len(flows_to_remove))
+                 flows_to_remove=len(flows_to_remove))
         log.debug('logical-flows-details', flows_to_add=flows_to_add,
                   flows_to_remove=flows_to_remove)
         assert len(groups) == 0, "Cannot yet deal with groups"
@@ -237,7 +238,7 @@
 
     def update_pm_config(self, device, pm_configs):
         log.info('update_pm_config - Not implemented yet', device=device,
-                  pm_configs=pm_configs)
+                 pm_configs=pm_configs)
         raise NotImplementedError()
 
     def send_proxied_message(self, proxy_address, msg):
@@ -375,13 +376,13 @@
             handler.delete_child_device(child_device)
         else:
             log.error('Could not find matching handler',
-                      looking_for_device_id =parent_device_id,
+                      looking_for_device_id=parent_device_id,
                       available_handlers=self.devices.keys())
 
     # This is currently not part of the Iadapter interface
     def collect_stats(self, device_id):
         log.info('collect_stats', device_id=device_id)
-        handler= self.devices[device_id]
+        handler = self.devices[device_id]
         if handler is not None:
             handler.trigger_statistics_collection()
         else:
@@ -395,7 +396,8 @@
         if device.id not in self.devices:
             log.error("Device does not exist", device_id=device.id)
             return OperationResp(code=OperationResp.OPERATION_FAILURE,
-                                      additional_info="Device %s does not exist" % device.id)
+                                 additional_info="Device %s does not exist"
+                                 % device.id)
 
         handler = self.devices[device.id]
 
diff --git a/voltha/adapters/openolt/openolt_device.py b/voltha/adapters/openolt/openolt_device.py
index 943fb66..14d48a8 100644
--- a/voltha/adapters/openolt/openolt_device.py
+++ b/voltha/adapters/openolt/openolt_device.py
@@ -187,9 +187,9 @@
 
         self.platform = self.platform_class(self.log, device_info)
         self.resource_mgr = self.resource_mgr_class(self.device_id,
-                                                        self.host_and_port,
-                                                        self.extra_args,
-                                                        device_info)
+                                                    self.host_and_port,
+                                                    self.extra_args,
+                                                    device_info)
 
         self.flow_mgr = self.flow_mgr_class(self.log, self.stub,
                                             self.device_id,
@@ -208,7 +208,6 @@
         device.hardware_version = device_info.hardware_version
         device.firmware_version = device_info.firmware_version
 
-
         # TODO: check for uptime and reboot if too long (VOL-1192)
 
         device.connect_status = ConnectStatus.REACHABLE
@@ -403,8 +402,6 @@
             serial_number=serial_number_str)
 
         if onu_device is None:
-            onu_id = self.new_onu_id(intf_id)
-
             try:
                 onu_id = self.resource_mgr.get_onu_id(intf_id)
                 if onu_id is None:
@@ -496,16 +493,17 @@
                            onu_id=onu_indication.onu_id)
             return
 
-        # We will use this alloc_id and gemport_id to pass on to the onu adapter
+        # We will use this alloc_id, gemport_id to pass on to the onu adapter
         pon_intf_onu_id = (onu_indication.intf_id, onu_indication.onu_id)
         alloc_id = self.resource_mgr.get_alloc_id(pon_intf_onu_id)
         gemport_id = self.resource_mgr.get_gemport_id(pon_intf_onu_id)
 
         if self.platform.intf_id_from_pon_port_no(onu_device.parent_port_no) \
                 != onu_indication.intf_id:
+            previous_intf_id = self.platform.intf_id_from_pon_port_no(
+                onu_device.parent_port_no),
             self.log.warn('ONU-is-on-a-different-intf-id-now',
-                          previous_intf_id=self.platform.intf_id_from_pon_port_no(
-                              onu_device.parent_port_no),
+                          previous_intf_id=previous_intf_id,
                           current_intf_id=onu_indication.intf_id)
             # FIXME - handle intf_id mismatch (ONU move?)
 
@@ -517,7 +515,7 @@
                           received_onu_id=onu_indication.onu_id)
 
         uni_no = self.platform.mk_uni_port_num(onu_indication.intf_id,
-                                          onu_indication.onu_id)
+                                               onu_indication.onu_id)
         uni_name = self.port_name(uni_no, Port.ETHERNET_UNI,
                                   serial_number=onu_device.serial_number)
 
@@ -669,7 +667,8 @@
                        flow_id=pkt_indication.flow_id)
 
         if pkt_indication.intf_type == "pon":
-            pon_intf_gemport = (pkt_indication.intf_id, pkt_indication.gemport_id)
+            pon_intf_gemport = (pkt_indication.intf_id,
+                                pkt_indication.gemport_id)
             try:
                 onu_id = int(self.resource_mgr.kv_store[pon_intf_gemport])
                 if onu_id is None:
@@ -679,8 +678,8 @@
                                gemport_id=pkt_indication.gemport_id, e=e)
                 return
 
-            logical_port_num = self.platform.mk_uni_port_num(pkt_indication.intf_id,
-                                                        onu_id)
+            logical_port_num = self.platform.mk_uni_port_num(
+                pkt_indication.intf_id, onu_id)
         elif pkt_indication.intf_type == "nni":
             logical_port_num = self.platform.intf_id_to_port_no(
                 pkt_indication.intf_id,
@@ -881,19 +880,6 @@
                 self.adapter_agent.delete_port(self.device_id, port)
                 return
 
-    def new_onu_id(self, intf_id):
-        onu_devices = self.adapter_agent.get_child_devices(self.device_id)
-        pon_onu_ids = [onu_device.proxy_address.onu_id
-                       for onu_device in onu_devices
-                       if onu_device.proxy_address.channel_id == intf_id]
-        for i in range(1, self.platform.max_onus_per_pon()):
-            if i not in pon_onu_ids:
-                return i
-
-        self.log.error('All available onu_ids taken on this pon',
-                       intf_id=intf_id, ids_taken=self.platform.max_onus_per_pon())
-        return None
-
     def update_flow_table(self, flows):
         self.log.debug('No updates here now, all is done in logical flows '
                        'update')
