From f51aaf5b5b949e6bfe82a797ccc0a886f4bb92ec Mon Sep 17 00:00:00 2001 From: J Boddey Date: Fri, 5 Apr 2024 13:46:15 +0100 Subject: [PATCH] Fix bug with deleting reports (#372) * Allow ARP from 0.0.0.0 * Fix logic * Fix deleting report --- framework/python/src/common/device.py | 4 ++-- framework/python/src/core/testrun.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/framework/python/src/common/device.py b/framework/python/src/common/device.py index 715603e41..51d68dfc6 100644 --- a/framework/python/src/common/device.py +++ b/framework/python/src/common/device.py @@ -43,9 +43,9 @@ def get_reports(self): def remove_report(self, timestamp: datetime): for report in self.reports: - if report.get_started() == timestamp: + if report.get_started().strftime('%Y-%m-%dT%H:%M:%S') == timestamp: self.reports.remove(report) - break + return def to_dict(self): """Returns the device as a python dictionary. This is used for the diff --git a/framework/python/src/core/testrun.py b/framework/python/src/core/testrun.py index 2c62108ee..4ca176a79 100644 --- a/framework/python/src/core/testrun.py +++ b/framework/python/src/core/testrun.py @@ -232,6 +232,7 @@ def delete_report(self, device: Device, timestamp): if report_folder == timestamp: shutil.rmtree(os.path.join(reports_folder, report_folder)) device.remove_report(timestamp) + LOGGER.debug('Successfully deleted the report') return True return False