-
Notifications
You must be signed in to change notification settings - Fork 685
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 scap delta tailoring #11145
Fix scap delta tailoring #11145
Conversation
Fix an issue in utils/create_scap_delta_tailoring.py
… not found Before this a call on None would cause the script to error out.
utils/create_scap_delta_tailoring.py
Outdated
@@ -178,7 +179,7 @@ def create_tailoring(args): | |||
|
|||
tailoring_root = ET.Element('xccdf-1.2:Tailoring') | |||
version = ET.SubElement(tailoring_root, 'xccdf-1.2:version', | |||
attrib={'time': datetime.datetime.utcnow().isoformat()}) | |||
attrib={'time': datetime.datetime.now(datetime.UTC).isoformat()}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the CI results we see that the new way doesn't work with Python 2.7 and 3.6 which we still support. The function hasn't been removed from 3.12, it's only deprecated. So I see 2 options: 1. don't do this change now, 2. create a wrapper function that would call either now(datetime.UTC)
or utcnow
depending on Python version or their presence.
Code Climate has analyzed commit fac076c 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 56.9%. View more on Code Climate. |
Description:
false
for every elementRationale:
Ensure the scripts works and is usable in future versions of Python.
Review Hints:
See each commit for more details.