Format code with black

This commit is contained in:
James Campbell 2025-06-02 03:41:15 -04:00
parent 375bf6a982
commit 22ae634a87
Signed by: james
GPG Key ID: 2287C33A40DC906A

View File

@ -496,6 +496,7 @@ def get_cluster_version():
return cluster_version return cluster_version
def version_num_to_release(version_num): def version_num_to_release(version_num):
""" """
Extract the revease from a version_num. Extract the revease from a version_num.
@ -515,7 +516,7 @@ def parse_version_rss(raw_rss, release):
Parse the raw RSS from the versions.rss feed to extract the latest version of Parse the raw RSS from the versions.rss feed to extract the latest version of
PostgreSQL that's availabe for the cluster being monitored. PostgreSQL that's availabe for the cluster being monitored.
This sets these global variables: This sets these global variables:
latest_version latest_version
latest_version_next_check latest_version_next_check
release_supported release_supported
@ -531,7 +532,9 @@ def parse_version_rss(raw_rss, release):
global release_supported global release_supported
# Regular expressions for parsing the RSS document # Regular expressions for parsing the RSS document
version_line = re.compile(r".*?([0-9][0-9.]+) is the latest release in the {} series.*".format(release)) version_line = re.compile(
r".*?([0-9][0-9.]+) is the latest release in the {} series.*".format(release)
)
unsupported_line = re.compile(r"^This version is unsupported") unsupported_line = re.compile(r"^This version is unsupported")
# Loop through the RSS until we find the current release # Loop through the RSS until we find the current release
@ -550,9 +553,7 @@ def parse_version_rss(raw_rss, release):
"{}{:02}{:02}".format(parts[0], parts[1], parts[2]) "{}{:02}{:02}".format(parts[0], parts[1], parts[2])
) )
else: else:
latest_version = int( latest_version = int("{}00{:02}".format(parts[0], parts[1]))
"{}00{:02}".format(parts[0], parts[1])
)
elif release_found: elif release_found:
# The next line after the version tells if the version is supported # The next line after the version tells if the version is supported
if unsupported_line.match(line): if unsupported_line.match(line):
@ -563,9 +564,7 @@ def parse_version_rss(raw_rss, release):
# Make sure we actually found it # Make sure we actually found it
if not release_found: if not release_found:
raise LatestVersionCheckError( raise LatestVersionCheckError("Current release ({}) not found".format(release))
"Current release ({}) not found".format(release)
)
log.info( log.info(
"Got latest PostgreSQL version: {} supported={}".format( "Got latest PostgreSQL version: {} supported={}".format(