Skip to content

Commit

Permalink
Fix flake8 error
Browse files Browse the repository at this point in the history
  • Loading branch information
pritchyspritch committed May 21, 2024
1 parent f94370a commit 3e2b624
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
21 changes: 18 additions & 3 deletions build_tech_assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,15 @@ def build_db_tm(name: str, asset_type: str) -> tuple:
"size": "service",
"technology": "database",
"machine": "virtual",
"tags": [name, "azure", "azure-sql", "sql", "microsoft-sql", "database", asset_type],
"tags": [
name,
"azure",
"azure-sql",
"sql",
"microsoft-sql",
"database",
asset_type,
],
}
with open("yaml-templates/technical_asset_template.yaml") as template_file:
template_str = template_file.read()
Expand All @@ -183,7 +191,14 @@ def build_vm_tm(name: str, asset_type: str) -> tuple:
"size": "system",
"technology": "web-server",
"machine": "virtual",
"tags": [name, "azure", "azure-virtual-machine", "virtual-machine", "vm", asset_type],
"tags": [
name,
"azure",
"azure-virtual-machine",
"virtual-machine",
"vm",
asset_type,
],
}
with open("yaml-templates/technical_asset_template.yaml") as template_file:
template_str = template_file.read()
Expand All @@ -192,4 +207,4 @@ def build_vm_tm(name: str, asset_type: str) -> tuple:

tag_list = vm_dict["tags"]

return vm_asset_yaml, tag_list
return vm_asset_yaml, tag_list
13 changes: 9 additions & 4 deletions dfe_threagile.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import argparse
import os
import sys
import re

from jinja2 import Template

Expand All @@ -13,7 +12,7 @@
build_app_service_tm,
build_storage_tm,
build_db_tm,
build_vm_tm
build_vm_tm,
)
from build_data_assets import (
build_client_app_data_asset,
Expand Down Expand Up @@ -246,7 +245,11 @@ def data_assets() -> list:


def template_inject(
yaml_list: list, data_list: list, all_tags: list, risks: list = [], autoescape: bool = True
yaml_list: list,
data_list: list,
all_tags: list,
risks: list = [],
autoescape: bool = True,
) -> str:
with open("yaml-templates/threagile-example-model-template.yaml") as template_file:
template_str = template_file.read()
Expand Down Expand Up @@ -387,7 +390,9 @@ def produce_asset_lists() -> tuple:

risks = read_risks_json("/app/work/output/risks.json")

final_with_risks = template_inject(yaml_list, data_list, all_tags, risks, autoescape=False)
final_with_risks = template_inject(
yaml_list, data_list, all_tags, risks, autoescape=False
)

try:
with open(
Expand Down

0 comments on commit 3e2b624

Please sign in to comment.