MitchDrage commented on code in PR #14841:
URL: https://github.com/apache/cloudstack/pull/14841#discussion_r4693437509
##########
systemvm/debian/root/health_checks/router_version_check.py:
##########
@@ -34,7 +39,30 @@ def getFirstLine(file=None):
return None
+def frr_version():
+ """Returns the installed FRR package version, or None when it cannot
tell."""
+ try:
+ out = subprocess.check_output(["dpkg-query", "-W", "-f=${Version}",
"frr"], stderr=subprocess.DEVNULL)
+ except (OSError, subprocess.CalledProcessError):
+ return None
+ version = out.decode().strip()
+ return version or None
+
+
+def capability_report():
+ """One line naming the BGP tools present: frrreload=yes|no bfdd=yes|no
frrmajor=<n>|none."""
+ version = frr_version()
+ match = re.match(r'^(\d+)\.', version) if version else None
+ frr_reload = "yes" if path.isfile(FRR_RELOAD_PATH) else "no"
+ bfdd = "yes" if path.isfile(BFDD_PATH) else "no"
+ major = match.group(1) if match else "none"
+ return "frrreload=%s bfdd=%s frrmajor=%s" % (frr_reload, bfdd, major)
+
Review Comment:
Yes, bfdd comes with the frr package on every template, so I'll remove that
check too.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]