From bd955f077f9a8ec4523a32e3e5c21cc08d224575 Mon Sep 17 00:00:00 2001 From: okozachenko Date: Wed, 30 Aug 2023 23:08:45 +1000 Subject: [PATCH] Update health probe script in nova If we define ovsdb_connection in os_vif_ovs config group, health probe fails for nova-compute because of the wrong condition to detect db connection string from configuration file. This patch detects db connection string using string.startswith() in a more strict way. Change-Id: I12a3ea4061d5c13879b878b85eb206726b5db27c --- nova/Chart.yaml | 2 +- nova/templates/bin/_health-probe.py.tpl | 3 ++- releasenotes/notes/nova.yaml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/nova/Chart.yaml b/nova/Chart.yaml index 259eefb789..b990122adb 100644 --- a/nova/Chart.yaml +++ b/nova/Chart.yaml @@ -14,7 +14,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Nova name: nova -version: 0.3.20 +version: 0.3.21 home: https://docs.openstack.org/nova/latest/ icon: https://www.openstack.org/themes/openstack/images/project-mascots/Nova/OpenStack_Project_Nova_vertical.png sources: diff --git a/nova/templates/bin/_health-probe.py.tpl b/nova/templates/bin/_health-probe.py.tpl index 660d62b627..6450301ae3 100644 --- a/nova/templates/bin/_health-probe.py.tpl +++ b/nova/templates/bin/_health-probe.py.tpl @@ -34,6 +34,7 @@ Usage example for Nova Compute: import json import os import psutil +import re import signal import socket import sys @@ -142,7 +143,7 @@ def configured_port_in_conf(): try: with open(sys.argv[2]) as conf_file: for line in conf_file: - if "connection =" in line: + if re.match(r'^\s*connection\s*=', line): service = line.split(':', 3)[3].split('/')[1].rstrip('\n') if service == "nova": database_ports.add( diff --git a/releasenotes/notes/nova.yaml b/releasenotes/notes/nova.yaml index bd9fe240c3..1f0940b0c1 100644 --- a/releasenotes/notes/nova.yaml +++ b/releasenotes/notes/nova.yaml @@ -89,4 +89,5 @@ nova: - 0.3.18 Fix nova ssh keys permission - 0.3.19 Add support for enabling vencrypt - 0.3.20 Add cinder auth config + - 0.3.21 Update health probe script considering ovsdb_connection config ...