Skip to content

Commit

Permalink
Merge pull request #19 from Patrowl/develop
Browse files Browse the repository at this point in the history
1.2.2 Fix clean API
  • Loading branch information
sebastien-powl authored Nov 28, 2024
2 parents e73f037 + a4bb394 commit 8683331
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions PatrowlEnginesUtils/PatrowlEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ def _getsslcontext(self, options):

return context

def clean(self, scan_id):
"""Clean all the scans."""
def clean(self) -> tuple[dict, int]:
"""Clean all scans."""
res = {"page": "clean"}
# Terminate processes
for scan_id in self.scans.keys():
Expand All @@ -235,7 +235,7 @@ def clean(self, scan_id):
res.update({"status": "success"})
return jsonify(res), 200

def clean_scan(self, scan_id):
def clean_scan(self, scan_id: int) -> tuple[dict, int]:
"""Clean a scan identified by his 'id'."""
res = {"page": "clean_scan"}
res.update({"scan_id": scan_id})
Expand All @@ -257,7 +257,7 @@ def clean_scan(self, scan_id):

self.scans.pop(scan_id)
res.update({"status": "removed"})
return jsonify(res)
return jsonify(res), 200

def _engine_is_busy(self):
"""Returns if engine is busy scanning."""
Expand Down
2 changes: 1 addition & 1 deletion PatrowlEnginesUtils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@


__title__ = 'patrowl_engine_utils'
__version__ = '1.2.1'
__version__ = '1.2.2'
__author__ = 'Nicolas MATTIOCCO'
__license__ = 'AGPLv3'
__copyright__ = 'Copyright (C) 2018-2021 Nicolas Mattiocco - @MaKyOtOx'
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.1
1.2.2
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name='PatrowlEnginesUtils',
version='1.2.1',
version='1.2.2',
description='Common classes for PatrowlEngines',
url='https://github.com/Patrowl/PatrowlEnginesUtils',
author='Nicolas Mattiocco',
Expand Down

0 comments on commit 8683331

Please sign in to comment.