diff --git a/sonic-psud/setup.py b/sonic-psud/setup.py index 4f8b77216..604c8e575 100644 --- a/sonic-psud/setup.py +++ b/sonic-psud/setup.py @@ -35,6 +35,7 @@ 'Natural Language :: English', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.7', 'Topic :: System :: Hardware', ], keywords='sonic SONiC psu PSU daemon psud PSUD', diff --git a/sonic-syseepromd/setup.py b/sonic-syseepromd/setup.py index b90dc66a7..5a8eb41f1 100644 --- a/sonic-syseepromd/setup.py +++ b/sonic-syseepromd/setup.py @@ -26,6 +26,7 @@ 'Natural Language :: English', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.7', 'Topic :: System :: Hardware', ], keywords='sonic SONiC SYSEEPROM syseeprom SYSEEPROMD syseepromd', diff --git a/sonic-thermalctld/scripts/thermalctld b/sonic-thermalctld/scripts/thermalctld index 59966ece7..2f448ddaa 100644 --- a/sonic-thermalctld/scripts/thermalctld +++ b/sonic-thermalctld/scripts/thermalctld @@ -116,7 +116,7 @@ class FanStatus(logger.Logger): def _check_speed_value_available(self, speed, target_speed, tolerance, current_status): if speed == NOT_AVAILABLE or target_speed == NOT_AVAILABLE or tolerance == NOT_AVAILABLE: - if tolerance > 100 or tolerance < 0: + if isinstance(tolerance, int) and (tolerance > 100 or tolerance < 0): self.log_warning('Invalid tolerance value: {}'.format(tolerance)) return False diff --git a/sonic-thermalctld/setup.py b/sonic-thermalctld/setup.py index ada08a1d3..abf1c8deb 100644 --- a/sonic-thermalctld/setup.py +++ b/sonic-thermalctld/setup.py @@ -34,6 +34,7 @@ 'Natural Language :: English', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.7', 'Topic :: System :: Hardware', ], keywords='sonic SONiC THERMALCONTROL thermalcontrol THERMALCTL thermalctl thermalctld', diff --git a/sonic-xcvrd/setup.py b/sonic-xcvrd/setup.py index dfb3fa508..174504f79 100644 --- a/sonic-xcvrd/setup.py +++ b/sonic-xcvrd/setup.py @@ -34,6 +34,7 @@ 'Natural Language :: English', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.7', 'Topic :: System :: Hardware', ], keywords = 'sonic SONiC TRANSCEIVER transceiver daemon XCVRD xcvrd', diff --git a/sonic-xcvrd/xcvrd/xcvrd.py b/sonic-xcvrd/xcvrd/xcvrd.py index c803fca1a..91cbd53f6 100644 --- a/sonic-xcvrd/xcvrd/xcvrd.py +++ b/sonic-xcvrd/xcvrd/xcvrd.py @@ -22,7 +22,7 @@ from swsscommon import swsscommon from .xcvrd_utilities import y_cable_helper -except ImportError, e: +except ImportError as e: raise ImportError (str(e) + " - required module not found") # @@ -1003,7 +1003,7 @@ def task_worker(self, stopping_event, sfp_error_event, y_cable_presence): # 1. the state has been normal before got the event # 2. the state was init and transition to normal after got the event. # this is for the vendors who don't implement "system_not_ready/system_becom_ready" logic - for key, value in port_dict.iteritems(): + for key, value in port_dict.items(): logical_port_list = platform_sfputil.get_physical_to_logical(int(key)) if logical_port_list is None: helper_logger.log_warning("Got unknown FP port index {}, ignored".format(key)) @@ -1210,7 +1210,7 @@ def init(self): # For single ASIC platforms we pass port_config_file_path and the asic_inst as 0 port_config_file_path = device_info.get_path_to_port_config_file() platform_sfputil.read_porttab_mappings(port_config_file_path, 0) - except Exception, e: + except Exception as e: self.log_error("Failed to read port info: %s" % (str(e)), True) sys.exit(PORT_CONFIG_LOAD_ERROR) diff --git a/sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py b/sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py index 29118527a..bf3edacfb 100644 --- a/sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py +++ b/sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py @@ -10,7 +10,7 @@ from sonic_py_common import multi_asic from sonic_y_cable import y_cable from swsscommon import swsscommon -except ImportError, e: +except ImportError as e: raise ImportError(str(e) + " - required module not found") @@ -403,7 +403,7 @@ def change_ports_status_for_y_cable_change_event(port_dict, y_cable_presence, st port_table_keys[asic_id] = port_tbl[asic_id].getKeys() # Init PORT_STATUS table if ports are on Y cable and an event is received - for key, value in port_dict.iteritems(): + for key, value in port_dict.items(): logical_port_list = y_cable_platform_sfputil.get_physical_to_logical(int(key)) if logical_port_list is None: helper_logger.log_warning("Got unknown FP port index {}, ignored".format(key))