container: Remove external depenceny - dateutil

Used a function from the standard library instead.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Joseph Nuthalapati 2020-07-11 10:27:34 +05:30 committed by Veiko Aasa
parent 359a0acd1a
commit 7d143c9ef2
No known key found for this signature in database
GPG Key ID: 478539CAE680674E

View File

@ -126,7 +126,6 @@ import tempfile
import time
import urllib.parse
from dateutil.parser import parse
from urllib.request import urlopen
URLS = {
@ -781,8 +780,9 @@ def _get_latest_image_timestamp(distribution):
url = URLS[distribution]
response = urlopen(url[0:url.rindex('/')])
page_contents = response.read().decode()
str_time = re.findall(r'\d{2}-[A-Z][a-z]{2}-\d{4}', page_contents)[0]
return parse(str_time).timestamp()
str_time = re.findall(r'\d{2}-[A-Z][a-z]{2}-\d{4} \d{2}:\d{2}',
page_contents)[0]
return datetime.datetime.strptime(str_time, '%d-%b-%Y %H:%M').timestamp()
def _is_update_required(distribution):