@@ -27,8 +27,8 @@ class CmisApi(XcvrApi):
2727
2828 def __init__ (self , xcvr_eeprom ):
2929 super (CmisApi , self ).__init__ (xcvr_eeprom )
30- self .vdm = CmisVdmApi (xcvr_eeprom )
31- self .cdb = CmisCdbApi (xcvr_eeprom )
30+ self .vdm = CmisVdmApi (xcvr_eeprom ) if not self . is_flat_memory () else None
31+ self .cdb = CmisCdbApi (xcvr_eeprom ) if not self . is_flat_memory () else None
3232
3333 def get_model (self ):
3434 '''
@@ -1015,7 +1015,7 @@ def get_vdm(self):
10151015 '''
10161016 This function returns all the VDM items, including real time monitor value, threholds and flags
10171017 '''
1018- vdm = self .vdm .get_vdm_allpage () if not self .is_flat_memory () else {}
1018+ vdm = self .vdm .get_vdm_allpage () if self .vdm is not None else {}
10191019 return vdm
10201020
10211021 def get_module_firmware_fault_state_changed (self ):
@@ -1116,6 +1116,9 @@ def get_module_fw_mgmt_feature(self, verbose = False):
11161116 the following upgrade with depend on these parameters.
11171117 """
11181118 txt = ''
1119+ if self .cdb is None :
1120+ return {'status' : False , 'info' : "CDB Not supported" , 'result' : None }
1121+
11191122 # get fw upgrade features (CMD 0041h)
11201123 starttime = time .time ()
11211124 autopaging = self .xcvr_eeprom .read (consts .AUTO_PAGING_SUPPORT )
@@ -1166,6 +1169,10 @@ def get_module_fw_info(self):
11661169 Validity Status: 1 = invalid, 0 = valid
11671170 """
11681171 txt = ''
1172+
1173+ if self .cdb is None :
1174+ return {'status' : False , 'info' : "CDB Not supported" , 'result' : None }
1175+
11691176 # get fw info (CMD 0100h)
11701177 rpllen , rpl_chkcode , rpl = self .cdb .get_fw_info ()
11711178 # password issue
@@ -1250,6 +1257,8 @@ def module_fw_run(self, mode = 0x01):
12501257 """
12511258 # run module FW (CMD 0109h)
12521259 txt = ''
1260+ if self .cdb is None :
1261+ return False , "CDB NOT supported on this module"
12531262 starttime = time .time ()
12541263 fw_run_status = self .cdb .run_fw_image (mode )
12551264 if fw_run_status == 1 :
@@ -1280,6 +1289,8 @@ def module_fw_commit(self):
12801289 Otherwise it will return False.
12811290 """
12821291 txt = ''
1292+ if self .cdb is None :
1293+ return False , "CDB NOT supported on this module"
12831294 # commit module FW (CMD 010Ah)
12841295 starttime = time .time ()
12851296 fw_commit_status = self .cdb .commit_fw_image ()
@@ -1337,6 +1348,9 @@ def module_fw_download(self, startLPLsize, maxblocksize, lplonly_flag, autopagin
13371348 This function returns True if download successfully completes. Otherwise it will return False where it fails.
13381349 """
13391350 txt = ''
1351+ if self .cdb is None :
1352+ return False , "CDB NOT supported on this module"
1353+
13401354 # start fw download (CMD 0101h)
13411355 starttime = time .time ()
13421356 try :
0 commit comments