From 0e22eb6c6e0b20bb84403e5fae4d9b26728057d5 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Wed, 8 Sep 2021 05:35:52 -0700 Subject: [PATCH] container: Fix the update command for new web server Closes: #2109. We moved from Nginx to Apache on ftp.freedombox.org. This changed the datetime format in the index pages we were relying on to find the difference with local image. Update this datetime format. Tests: - Run ./container update with an old image already in the .container directory. New image will be downloaded and verified. - Run ./container update immediately after downloading the latest image. No new download is done. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- container | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/container b/container index c0a945667..068de7962 100755 --- a/container +++ b/container @@ -928,9 +928,8 @@ 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} \d{2}:\d{2}', - page_contents)[0] - return datetime.datetime.strptime(str_time, '%d-%b-%Y %H:%M').timestamp() + str_time = re.findall(r'\d{4}-\d{2}-\d{2} \d{2}:\d{2}', page_contents)[0] + return datetime.datetime.strptime(str_time, '%Y-%m-%d %H:%M').timestamp() def _is_update_required(distribution):