Fix SCAP Delta Tailoring#13542
Merged
jan-cerny merged 2 commits intoJun 6, 2025
Merged
Conversation
f3277c8 to
8de774e
Compare
|
Code Climate has analyzed commit 8de774e and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 61.9% (0.0% change). View more on Code Climate. |
jan-cerny
approved these changes
Jun 6, 2025
Collaborator
jan-cerny
left a comment
There was a problem hiding this comment.
On current master I run cmake -DSSG_BUILD_DISA_DELTA_FILES=ON -DSSG_PRODUCT_DEFAULT=OFF -DSSG_PRODUCT_RHEL8=ON .. && make and I experience the following traceback:
Traceback (most recent call last):
File "/home/jcerny/work/git/scap-security-guide/utils/create_scap_delta_tailoring.py", line 274, in <module>
main()
~~~~^^
File "/home/jcerny/work/git/scap-security-guide/utils/create_scap_delta_tailoring.py", line 250, in main
tailoring_root = create_tailoring(args)
File "/home/jcerny/work/git/scap-security-guide/utils/create_scap_delta_tailoring.py", line 180, in create_tailoring
profile_root = get_profile(args.product, args.profile)
File "/home/jcerny/work/git/scap-security-guide/utils/create_scap_delta_tailoring.py", line 28, in get_profile
ds_root = ET.parse(os.path.join(SSG_ROOT, 'build', 'ssg-{product}-ds.xml'
~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.format(product=product))).getroot()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.13/xml/etree/ElementTree.py", line 1204, in parse
tree.parse(source, parser)
~~~~~~~~~~^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.13/xml/etree/ElementTree.py", line 558, in parse
source = open(source, "rb")
FileNotFoundError: [Errno 2] No such file or directory: '/home/jcerny/work/git/scap-security-guide/build/ssg-rhel8-ds.xml'
With this PR I don't experience the trace back any more. I successfully receive a tailoring file in rhel8/tailoring/rhel8_stig_delta_tailoring.xml.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Always use build root for delta tailoring.
Rationale:
So we can remove a downstream patch.
Review Hints:
Build
-DSSG_BUILD_DISA_DELTA_FILES=ONand not inbuild. That should expose this bug on master.