Skip to content

Commit

Permalink
[pan-os] Add automation for versions retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
marcwrobel committed Aug 15, 2024
1 parent f238224 commit 1e72cea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/common/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def parse_datetime(text: str, formats: list[str] = frozenset([
"%Y-%m-%d %H:%M:%S %z", # 2023-05-01 08:32:34 +0900
"%Y-%m-%dT%H:%M:%S%z", # 2023-05-01T08:32:34+0900
"%Y-%m-%dT%H:%M:%S.%f%z", # 2023-05-01T08:32:34.123456Z
"%Y/%m/%d %H:%M:%S", # 2023/05/01 08:32:34
"%a %d %b %Y %H:%M:%S %Z", # Wed, 01 Jan 2020 00:00:00 GMT
]), to_utc: bool = True) -> datetime:
"""Parse a given text representing a datetime using a list of formats,
Expand Down
11 changes: 11 additions & 0 deletions src/pan-os.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from common import dates, http, releasedata

"""Fetches pan-os versions from https://github.com/mrjcap/panos-versions/."""

with releasedata.ProductData("pan-os") as product_data:
versions = http.fetch_url("https://raw.githubusercontent.com/mrjcap/panos-versions/master/PaloAltoVersions.json").json()

for version in versions:
name = version['version']
date = dates.parse_datetime(version['released-on'])
product_data.declare_version(name, date)

0 comments on commit 1e72cea

Please sign in to comment.