Skip to content

Commit

Permalink
profile_tool.py: Fix traceback in sub command
Browse files Browse the repository at this point in the history
Fix traceback when diffing profile sources.
  • Loading branch information
yuumasato committed Mar 1, 2024
1 parent eb2f364 commit d76368a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions utils/profile_tool/sub.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import os
import jinja2
from ssg.build_cpe import ProductCPEs
from ssg.build_yaml import Profile
from ssg.environment import open_environment


def command_sub(args):
product_yaml = os.path.join(args.ssg_root, "products", args.product, "product.yml")
env_yaml = open_environment(args.build_config_yaml, product_yaml)

product_cpes = ProductCPEs()
product_cpes.load_product_cpes(env_yaml)
product_cpes.load_content_cpes(env_yaml)
try:
profile1 = Profile.from_yaml(args.profile1, env_yaml)
profile2 = Profile.from_yaml(args.profile2, env_yaml)
profile1 = Profile.from_yaml(args.profile1, env_yaml, product_cpes)
profile2 = Profile.from_yaml(args.profile2, env_yaml, product_cpes)
except jinja2.exceptions.TemplateNotFound as e:
print("Error: Profile {} could not be found.".format(str(e)))
exit(1)
Expand Down

0 comments on commit d76368a

Please sign in to comment.