Skip to content

Conversation

PeaceRebel
Copy link
Contributor

Not all images includes the timestamp with microseconds.

Fixes: #4308

@PeaceRebel PeaceRebel self-assigned this Sep 10, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the timestamp parsing logic to ignore microseconds, which is a good improvement for compatibility. I've added one suggestion to make the string manipulation for removing fractional seconds more robust and readable by using str.partition() instead of relying on string length and slicing.

jbtrystram
jbtrystram previously approved these changes Sep 10, 2025
Copy link
Member

@jbtrystram jbtrystram left a comment

Choose a reason for hiding this comment

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

LGTM.
Thanks !

jbtrystram
jbtrystram previously approved these changes Sep 10, 2025
@PeaceRebel PeaceRebel requested a review from jlebon September 10, 2025 17:03
Not all images includes the timestamp with microseconds.

Fixes: coreos#4308
Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Nice, thanks!


import argparse
import datetime
from dateutil import (parser, tz)
Copy link
Member

Choose a reason for hiding this comment

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

Minor: parser here is shadowed by parser in parse_args. Not worth the respin, though it's good to avoid shadowing in general.

@jlebon jlebon merged commit a7a38ee into coreos:main Sep 11, 2025
5 of 6 checks passed
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.

cmd-import fails on unexpected timestamp format
3 participants