Format code with black
This commit is contained in:
parent
375bf6a982
commit
22ae634a87
13
src/pgmon.py
13
src/pgmon.py
@ -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.
|
||||||
@ -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(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user