Adtran OLT: Fix end of GemPort ID range

Change-Id: I91f42f6cb5cbcc145285cb55722efedb7ff2e753
diff --git a/voltha/adapters/adtran_olt/adtran_olt.py b/voltha/adapters/adtran_olt/adtran_olt.py
index b64d6e4..ac8c495 100644
--- a/voltha/adapters/adtran_olt/adtran_olt.py
+++ b/voltha/adapters/adtran_olt/adtran_olt.py
@@ -52,7 +52,7 @@
         self.descriptor = Adapter(
             id=self.name,
             vendor='ADTRAN, Inc.',
-            version='1.31',
+            version='1.32',
             config=AdapterConfig(log_level=LogLevel.INFO)
         )
         log.debug('adtran_olt.__init__', adapter_agent=adapter_agent)
diff --git a/voltha/adapters/adtran_olt/resources/adtran_olt_resource_manager.py b/voltha/adapters/adtran_olt/resources/adtran_olt_resource_manager.py
index fb26b4a..76fbab2 100644
--- a/voltha/adapters/adtran_olt/resources/adtran_olt_resource_manager.py
+++ b/voltha/adapters/adtran_olt/resources/adtran_olt_resource_manager.py
@@ -137,7 +137,7 @@
             resource_type=PONResourceManager.GEMPORT_ID,
             num_of_id=1
         )
-        if gemport_id_list and len(gemport_id_list) == 0:
+        if gemport_id_list is None or len(gemport_id_list) == 0:
             self.log.error("no-gemport-id-available")
             return None
 
@@ -145,16 +145,15 @@
         # allocated for the pon_intf_onu_id tuple
         self.resource_mgr.update_gemport_ids_for_onu(pon_intf_onu_id,
                                                      gemport_id_list)
-
         # We currently use only one gemport
         gemport = gemport_id_list[0]
 
         pon_intf_gemport = (pon_intf, gemport)
+
         # This information is used when packet_indication is received and
         # we need to derive the ONU Id for which the packet arrived based
         # on the pon_intf and gemport available in the packet_indication
         self.kv_store[str(pon_intf_gemport)] = str(onu_id)
-
         return gemport
 
     def free_pon_resources_for_onu(self, pon_intf_id_onu_id):
diff --git a/voltha/adapters/adtran_olt/resources/adtran_resource_manager.py b/voltha/adapters/adtran_olt/resources/adtran_resource_manager.py
index cfb3890..31fec4b 100644
--- a/voltha/adapters/adtran_olt/resources/adtran_resource_manager.py
+++ b/voltha/adapters/adtran_olt/resources/adtran_resource_manager.py
@@ -56,7 +56,7 @@
                 pon_intf_id=pon_id,
                 resource_type=PONResourceManager.GEMPORT_ID,
                 start_idx=self.pon_resource_ranges[PONResourceManager.GEMPORT_ID_START_IDX],
-                end_idx=self.pon_resource_ranges[PONResourceManager.GEMPORT_ID_START_IDX])
+                end_idx=self.pon_resource_ranges[PONResourceManager.GEMPORT_ID_END_IDX])
 
     def clear_device_resource_pool(self):
         """