Skip to content

Commit

Permalink
Merge pull request #19 from lacework-dev/add-author-and-customer-to-c…
Browse files Browse the repository at this point in the history
…li-options

add author / customer to args
  • Loading branch information
jvogt committed Sep 27, 2022
2 parents 392fff0 + 2802b75 commit bfbe9f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
cache: 'pip' # cache pip dependencies
- run: pip install -r requirements.txt
- run: pip --version
- run: python generate_report.py reports/jinja2/csa_report.py
- run: python generate_report.py reports/jinja2/csa_report.py --author Author --customer Customer
env:
LW_ACCOUNT: ${{ secrets.LW_ACCOUNT }}
LW_SUBACCOUNT: ${{ secrets.LW_SUBACCOUNT }}
Expand Down
6 changes: 4 additions & 2 deletions generate_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument("--report-path", help="Path to save report", default="report.html")
parser.add_argument("--use-cached-data", help="Use cached data (if available)", action='store_true')
parser.add_argument("--author", help="Author of report", type=str, required=True)
parser.add_argument("--customer", help="Customer Name (Company)", type=str, required=True)
parser.add_argument('report_generator', metavar='REPORT_GENERATOR', type=str, nargs=None,
help='Path to the report generator (eg: reports/datapane/compliance_report.py')
args = parser.parse_args()
Expand Down Expand Up @@ -50,8 +52,8 @@ def __init__(self):
self._7_days_ago = self._now - timedelta(days = 7)
self.use_cached_data = args.use_cached_data
self.cli_data = {
'customer': 'AcmeCoPlaceHolder',
'author': 'John Q. Placeholder'
'customer': args.customer,
'author': args.author
}

report.generate_report(_shared(), report_save_path=args.report_path, use_cached_data=args.use_cached_data)
Expand Down

0 comments on commit bfbe9f9

Please sign in to comment.