-
Notifications
You must be signed in to change notification settings - Fork 184
cmd-import: Ignore microseconds in 'created' timestamp label #4309
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
Conversation
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.
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.
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.
LGTM.
Thanks !
ff89ae0
to
4947322
Compare
Not all images includes the timestamp with microseconds. Fixes: coreos#4308
4947322
to
26d0b34
Compare
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.
Nice, thanks!
|
||
import argparse | ||
import datetime | ||
from dateutil import (parser, tz) |
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.
Minor: parser
here is shadowed by parser
in parse_args
. Not worth the respin, though it's good to avoid shadowing in general.
Not all images includes the timestamp with microseconds.
Fixes: #4308