mirror of
https://github.com/aljazceru/recon-pipeline.git
synced 2026-01-04 15:14:42 +01:00
Limit tab completion of scan command to scans with installed components (#74)
* scans without installed requirements dont tab-complete * added meets_requirements functions to classes * updated tests * added check for None case
This commit is contained in:
@@ -7,8 +7,9 @@ from luigi.util import inherits
|
||||
from luigi.contrib.sqla import SQLAlchemyTarget
|
||||
|
||||
import pipeline.models.db_manager
|
||||
from .targets import TargetList
|
||||
from ..tools import tools
|
||||
from .targets import TargetList
|
||||
from .helpers import get_tool_state
|
||||
from ..models.target_model import Target
|
||||
|
||||
|
||||
@@ -48,6 +49,15 @@ class AmassScan(luigi.Task):
|
||||
self.db_mgr = pipeline.models.db_manager.DBManager(db_location=self.db_location)
|
||||
self.results_subfolder = (Path(self.results_dir) / "amass-results").expanduser().resolve()
|
||||
|
||||
@staticmethod
|
||||
def meets_requirements():
|
||||
""" Reports whether or not this scan's needed tool(s) are installed or not """
|
||||
needs = ["amass"]
|
||||
tools = get_tool_state()
|
||||
|
||||
if tools:
|
||||
return all([tools.get(x).get("installed") is True for x in needs])
|
||||
|
||||
def requires(self):
|
||||
""" AmassScan depends on TargetList to run.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user