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

Use valid UUID4 for x-mitre-collection ID #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dandye
Copy link

@dandye dandye commented Sep 14, 2022

#3 #close

This is a follow-on for #3. The previous invalid UUID4 used for the ID for x-mitre-collection:

x-mitre-collection--23320f4-22ad-8467-3b73-ed0c869a12838
x-mitre-collection--12345678-1234-4321-1234-1234567890ab
x-mitre-collection--xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx

...was updated in #13 to be:

x-mitre-collection--402e24b4-436e-4936-b19b-2038648f489

...but this is also an invalid UUID4:

x-mitre-collection--402e24b4-436e-4936-b19b-2038648f489
x-mitre-collection--12345678-1234-4321-1234-1234567890ab
x-mitre-collection--xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx
python -c 'from uuid import UUID; print(UUID("402e24b4-436e-4936-b19b-2038648f489", version=4))'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/anaconda3/lib/python3.7/uuid.py", line 160, in __init__
    raise ValueError('badly formed hexadecimal UUID string')
ValueError: badly formed hexadecimal UUID string

This PR fixes it by appending 0 to the each occurrence of that ID:

grep -rl '"x-mitre-collection--402e24b4-436e-4936-b19b-2038648f489"' . | \
xargs sed -i '' \
-e 's/"x-mitre-collection--402e24b4-436e-4936-b19b-2038648f489"/"x-mitre-collection--402e24b4-436e-4936-b19b-2038648f4890"/g'

This is now a valid UUID4:

x-mitre-collection--402e24b4-436e-4936-b19b-2038648f4890
x-mitre-collection--12345678-1234-4321-1234-1234567890ab
x-mitre-collection--xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx
python -c 'from uuid import UUID; print(UUID("402e24b4-436e-4936-b19b-2038648f4890", version=4))'
402e24b4-436e-4936-b19b-2038648f4890

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.

1 participant