Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix utils/rule_dir_json.py when no product is detected when rendering OVAL #7978

Closed
wants to merge 1 commit into from

Conversation

JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Dec 9, 2021

ssh/oval.py's applicable_platform fails in some cases where a
product is not detected since it needs to be rendered in jinja.

This adds a parameter that passes the product name and takes it into use
in utils/rule_dir_json.py.

Signed-off-by: Juan Antonio Osorio Robles jaosorior@redhat.com

…ng OVAL

`ssh/oval.py`'s `applicable_platform` fails in some cases where a
product is not detected since it needs to be rendered in jinja.

This adds a parameter that passes the product name and takes it into use
in `utils/rule_dir_json.py`.

Signed-off-by: Juan Antonio Osorio Robles <jaosorior@redhat.com>
@matejak matejak added this to the 0.1.60 milestone Dec 9, 2021
@JAORMX JAORMX requested review from matejak and ggbecker December 9, 2021 11:47
@@ -117,7 +117,7 @@ def handle_ovals(product_list, product_yamls, rule_obj):
oval_product, _ = os.path.splitext(oval_name)
oval_obj = {'name': oval_name, 'product': oval_product}

platforms = ssg.oval.applicable_platforms(oval_path)
platforms = ssg.oval.applicable_platforms(oval_path, product=oval_product)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oval_product contains the directory name such as shared, firefox, jre, etc... it doesn't really contain a product per se. If the product is really relevant for the script, we should make it as a parameter and let cmake pass the right product. If we don't need it then we can just put some default value so it doesn't traceback.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uhm... let me see what I can do

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably the default example product introduced in #7979 will do the trick on a good-enough level - the utility in question is not designed to be product-specific, so for the time being let's hope that usage of the default product won't impact its result.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, actually this PR is not needed any more.

@JAORMX JAORMX closed this Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants