Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions src/cmd-import
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ it into a `cosa build`, as if one did `cosa build ostree`. One can then e.g.
'''

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.

import json
import os
import subprocess
Expand Down Expand Up @@ -229,13 +229,8 @@ def skopeo_inspect(image):


def parse_timestamp(timestamp):
# datetime's doesn't support nanoseconds.
# So trim it.
if len(timestamp) > 26 and timestamp[19] == '.':
timestamp = timestamp[:26] + "Z"

timestamp = datetime.datetime.strptime(timestamp, '%Y-%m-%dT%H:%M:%S.%fZ')
return rfc3339_time(timestamp.replace(tzinfo=datetime.timezone.utc))
timestamp = parser.parse(timestamp)
return rfc3339_time(timestamp.astimezone(tz.UTC))


if __name__ == '__main__':
Expand Down
Loading