Update project
This commit is contained in:
+2
-2
@@ -30,7 +30,7 @@ def getAllPlugins(audit):
|
||||
elif audit == "application":
|
||||
pass
|
||||
|
||||
def main():
|
||||
def main(path):
|
||||
args = checkArguments()
|
||||
|
||||
if args.plugins is not None:
|
||||
@@ -76,7 +76,7 @@ def main():
|
||||
pass
|
||||
|
||||
print("End of the audit. Generating the report")
|
||||
generateHtmlReport(report)
|
||||
generateHtmlReport(path, report)
|
||||
|
||||
@Dispatcher.register_plugins
|
||||
def sysctl(*args) -> dict:
|
||||
|
||||
+3
-3
@@ -4,8 +4,8 @@ from datetime import datetime
|
||||
import jinja2
|
||||
|
||||
|
||||
def generateHtmlReport(data):
|
||||
today = datetime.now().isoformat()[0:10].replace("-", "_")
|
||||
def generateHtmlReport(path, data):
|
||||
today = datetime.now().isoformat()[0:10]
|
||||
dataJinja2 = dict()
|
||||
dataJinja2['title'] = 'Report check system'
|
||||
dataJinja2['plugins'] = list()
|
||||
@@ -80,7 +80,7 @@ def generateHtmlReport(data):
|
||||
rdr = tmplIndex.render(data=dataJinja2)
|
||||
|
||||
hostname = data['hostname'].lower()
|
||||
with open(f"reports/reports_{hostname}_{today}.html", "w") as f:
|
||||
with open(f"{path}/reports/reports_{hostname}_{today}.html", "w") as f:
|
||||
f.write(rdr)
|
||||
|
||||
print("The report is generated at this location: " \
|
||||
|
||||
Reference in New Issue
Block a user