diff --git a/framework/python/src/api/api.py b/framework/python/src/api/api.py index e2a198ac1..0a00c19cd 100644 --- a/framework/python/src/api/api.py +++ b/framework/python/src/api/api.py @@ -285,7 +285,7 @@ async def get_version(self, response: Response): LOGGER.debug("The latest version is installed") return json_response - except Exception as e: + except Exception as e: # pylint: disable=W0703 response.status_code = 500 LOGGER.error("Failed to fetch latest version") LOGGER.debug(e) @@ -381,7 +381,7 @@ async def delete_device(self, request: Request, response: Response): return self._generate_msg(True, "Successfully deleted the device") # TODO: Find specific exception to catch - except Exception as e: + except Exception as e: # pylint: disable=W0703 LOGGER.error(e) response.status_code = 500 return self._generate_msg(False, "An error occured whilst deleting " + diff --git a/framework/python/src/common/device.py b/framework/python/src/common/device.py index 144161d8a..715603e41 100644 --- a/framework/python/src/common/device.py +++ b/framework/python/src/common/device.py @@ -42,9 +42,7 @@ def get_reports(self): return self.reports def remove_report(self, timestamp: datetime): - # remove_report_target = None for report in self.reports: - report_timestamp = report.get_started().strftime('%Y-%m-%dT%H:%M:%S') if report.get_started() == timestamp: self.reports.remove(report) break diff --git a/framework/python/src/common/testreport.py b/framework/python/src/common/testreport.py index 4f166e4e3..4c33f71af 100644 --- a/framework/python/src/common/testreport.py +++ b/framework/python/src/common/testreport.py @@ -241,7 +241,7 @@ def generate_module_pages(self, json_data): for module_reports in self._module_reports: # ToDo: Figure out how to make this dynamic - # Padding values from CSS + # Padding values from CSS # Element sizes from inspection of rendered report h1_padding = 8 module_summary_padding = 50 # 25 top and 25 bottom @@ -285,7 +285,7 @@ def generate_module_pages(self, json_data): # we'll add it to this page, otherweise, we'll put it on the next # page. Also make sure that if there is less than 40 pixels # left after a data row, start a new page or the row will get cut off. - # Current row size is 40.667 so rounding to 41 padding, + # Current row size is 40.667 so rounding to 41 padding, # adjust if we update the "module-data tbody tr" element. if content_size >= content_max_size or ( data_rows_active and content_max_size - content_size < 41): diff --git a/framework/python/src/common/util.py b/framework/python/src/common/util.py index d40571481..c485d5ff2 100644 --- a/framework/python/src/common/util.py +++ b/framework/python/src/common/util.py @@ -71,7 +71,7 @@ def get_os_user(): except OSError: # Handle the OSError exception LOGGER.error('An OS error occured whilst calling os.getlogin()') - except Exception: + except Exception: # pylint: disable=W0703 # Catch any other unexpected exceptions LOGGER.error('An unknown exception occured whilst calling os.getlogin()') return user diff --git a/framework/python/src/net_orc/network_orchestrator.py b/framework/python/src/net_orc/network_orchestrator.py index dd80f4a6e..8320ac3e8 100644 --- a/framework/python/src/net_orc/network_orchestrator.py +++ b/framework/python/src/net_orc/network_orchestrator.py @@ -82,7 +82,7 @@ def start(self): system_conf_runtime = os.path.join(conf_runtime_dir,'system.json') with open(system_conf_runtime, 'w', encoding='utf-8') as f: json.dump(self.get_session().get_config(), f, indent=2) - + # Get all components ready self.load_network_modules() @@ -199,9 +199,9 @@ def _device_discovered(self, mac_addr): wrpcap(os.path.join(device_runtime_dir, 'startup.pcap'), packet_capture) # Copy the device config file to the runtime directory - runtime_device_conf = os.path.join(device_runtime_dir,'device_config.json') + runtime_device_conf = os.path.join(device_runtime_dir,'device_config.json') with open(runtime_device_conf, 'w', encoding='utf-8') as f: - json.dump(self._session.get_target_device().to_config_json(), f, indent=2) + json.dump(self._session.get_target_device().to_config_json(), f, indent=2) if device.ip_addr is None: LOGGER.info( diff --git a/framework/python/src/net_orc/network_validator.py b/framework/python/src/net_orc/network_validator.py index 6673a1fdb..df9b96b1d 100644 --- a/framework/python/src/net_orc/network_validator.py +++ b/framework/python/src/net_orc/network_validator.py @@ -191,7 +191,7 @@ def _get_os_user(self): except OSError: # Handle the OSError exception LOGGER.error('An OS error occurred while retrieving the login name.') - except Exception as error: + except Exception as error: # pylint: disable=W0703 # Catch any other unexpected exceptions LOGGER.error('An exception occurred:', error) return user diff --git a/framework/python/src/test_orc/test_orchestrator.py b/framework/python/src/test_orc/test_orchestrator.py index 38f5e5267..d37afc09c 100644 --- a/framework/python/src/test_orc/test_orchestrator.py +++ b/framework/python/src/test_orc/test_orchestrator.py @@ -273,7 +273,7 @@ def _zip_results(self, dest_path): if os.path.exists(zip_file) else'creation failed'}''') - except Exception as error: + except Exception as error: # pylint: disable=W0703 LOGGER.error(f"Failed to create zip file: {error}") def test_in_progress(self): diff --git a/modules/test/conn/python/src/connection_module.py b/modules/test/conn/python/src/connection_module.py index 9429541de..54a9e0bb3 100644 --- a/modules/test/conn/python/src/connection_module.py +++ b/modules/test/conn/python/src/connection_module.py @@ -488,6 +488,7 @@ def _run_subnet_test(self, config): except Exception as e: # pylint: disable=W0718 LOGGER.error('Failed to restore DHCP server configuration: ' + str(e)) + LOGGER.error(traceback.format_exc()) return final_result, final_result_details diff --git a/testing/pylint/test_pylint b/testing/pylint/test_pylint index 82949d909..a330d54c3 100755 --- a/testing/pylint/test_pylint +++ b/testing/pylint/test_pylint @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -ERROR_LIMIT=175 +ERROR_LIMIT=0 sudo cmd/install