|
23 | 23 | except ImportError as e: |
24 | 24 | raise ImportError(str(e) + "- required module not found") |
25 | 25 |
|
26 | | -ext_media_module = None |
27 | | -try: |
28 | | - import ext_media_api as ext_media_module |
29 | | -except EnvironmentError: |
30 | | - ext_media_module = None |
| 26 | +# Enabled when ext_media is available |
| 27 | +#ext_media_module = None |
| 28 | +#try: |
| 29 | +# import ext_media_api as ext_media_module |
| 30 | +#except : |
| 31 | +# ext_media_module = None |
| 32 | +# pass |
31 | 33 |
|
32 | 34 | PAGE_OFFSET = 0 |
33 | 35 | KEY_OFFSET = 1 |
@@ -375,13 +377,13 @@ def get_transceiver_info(self): |
375 | 377 | except (ValueError, TypeError) : pass |
376 | 378 |
|
377 | 379 | # Attempt ext_media read |
378 | | - if ext_media_module is not None: |
379 | | - ext_media_dict = ext_media_module.get_ext_media_info(self) |
380 | | - for key in ext_media_dict: |
381 | | - value = ext_media_dict[key] |
382 | | - if value in [None, 'None', 'none','n/a', '']: |
383 | | - value = 'N/A' |
384 | | - transceiver_info_dict[key] = str(value) |
| 380 | +# if ext_media_module is not None: |
| 381 | +# ext_media_dict = ext_media_module.get_ext_media_info(self) |
| 382 | +# for key in ext_media_dict: |
| 383 | +# value = ext_media_dict[key] |
| 384 | +# if value in [None, 'None', 'none','n/a', '']: |
| 385 | +# value = 'N/A' |
| 386 | +# transceiver_info_dict[key] = str(value) |
385 | 387 |
|
386 | 388 | return transceiver_info_dict |
387 | 389 |
|
@@ -701,24 +703,24 @@ def get_temperature(self): |
701 | 703 | """ |
702 | 704 | Retrieves the temperature of this SFP |
703 | 705 | """ |
704 | | - temperature = None |
| 706 | + temperature = 'N/A' |
705 | 707 | try : |
706 | 708 | temperature_data = self._get_eeprom_data('Temperature') |
707 | 709 | temperature = temperature_data['data']['Temperature']['value'] |
708 | 710 | except (TypeError, ValueError): |
709 | | - return None |
| 711 | + return 'N/A' |
710 | 712 | return temperature |
711 | 713 |
|
712 | 714 | def get_voltage(self): |
713 | 715 | """ |
714 | 716 | Retrieves the supply voltage of this SFP |
715 | 717 | """ |
716 | | - voltage = None |
| 718 | + voltage = 'N/A' |
717 | 719 | try: |
718 | 720 | voltage_data = self._get_eeprom_data('Voltage') |
719 | 721 | voltage = voltage_data['data']['Vcc']['value'] |
720 | 722 | except (TypeError, ValueError): |
721 | | - return None |
| 723 | + return 'N/A' |
722 | 724 | return voltage |
723 | 725 |
|
724 | 726 | def get_tx_bias(self): |
|
0 commit comments