[pan] Fix new date ingestion
This commit is contained in:
@@ -1,4 +1,14 @@
|
|||||||
{
|
{
|
||||||
|
"3.1": "2014-09-03",
|
||||||
|
"3.2": "2015-03-31",
|
||||||
|
"3.3": "2015-11-10",
|
||||||
|
"3.4": "2016-08-21",
|
||||||
|
"4.0": "2017-04-05",
|
||||||
|
"4.1": "2017-09-15",
|
||||||
|
"4.2": "2018-06-25",
|
||||||
|
"5.0": "2018-03-19",
|
||||||
|
"6.0": "2019-02-26",
|
||||||
|
"6.1": "2019-07-02",
|
||||||
"7.0": "2019-12-04",
|
"7.0": "2019-12-04",
|
||||||
"7.1": "2020-04-22",
|
"7.1": "2020-04-22",
|
||||||
"7.2": "2020-09-07",
|
"7.2": "2020-09-07",
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import json
|
import json
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import datetime
|
import datetime
|
||||||
|
import re
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
URL = "https://www.paloaltonetworks.com/services/support/end-of-life-announcements/end-of-life-summary"
|
URL = "https://www.paloaltonetworks.com/services/support/end-of-life-announcements/end-of-life-summary"
|
||||||
@@ -28,14 +29,19 @@ def update_releases(html_identifier, file):
|
|||||||
version = version.removesuffix("-(cortex-xdr-agent)")
|
version = version.removesuffix("-(cortex-xdr-agent)")
|
||||||
version = version.removesuffix("-(vm-series-only)")
|
version = version.removesuffix("-(vm-series-only)")
|
||||||
version = version.removesuffix("-(panorama-only)")
|
version = version.removesuffix("-(panorama-only)")
|
||||||
try:
|
if len(td_list) > 1 and version != "":
|
||||||
month, date, year = td_list[1].get_text().split("/")
|
# Date formats differ between different products
|
||||||
abs_date = f"{year}-{month:0>2}-{date:0>2}"
|
try:
|
||||||
except Exception:
|
month, date, year = td_list[1].get_text().split("/")
|
||||||
date = datetime.datetime.strptime(td_list[1].get_text(), "%B %d, %Y")
|
abs_date = f"{year}-{month:0>2}-{date:0>2}"
|
||||||
abs_date = date.strftime("%Y-%m-%d")
|
except Exception:
|
||||||
|
# A few dates have 1st, 2nd, 4th etc. Fix that:
|
||||||
|
d = td_list[1].get_text()
|
||||||
|
d = re.sub(r'(\w+) (\d{1,2})(?:\w{2}), (\d{4})', r'\1 \2, \3', d)
|
||||||
|
date = datetime.datetime.strptime(d, "%B %d, %Y")
|
||||||
|
abs_date = date.strftime("%Y-%m-%d")
|
||||||
|
|
||||||
versions[version] = abs_date
|
versions[version] = abs_date
|
||||||
|
|
||||||
with open("releases/%s.json" % file, "w") as f:
|
with open("releases/%s.json" % file, "w") as f:
|
||||||
f.write(json.dumps(versions, indent=2))
|
f.write(json.dumps(versions, indent=2))
|
||||||
|
|||||||
Reference in New Issue
Block a user