From 620286117bf5f023bf3d352bb8c73f6108e3fd7c Mon Sep 17 00:00:00 2001 From: sungil Date: Tue, 17 Dec 2019 10:46:08 +0000 Subject: [PATCH] Improve accuracy for version detection on nova Because it's almost time for expiring on some python version, OpenStack client running on that version generates some messages for warning. Two scripts on nova Fixed by this PS get version information using the OpenStack client without any protection for this kinds of messages. This PS gives a little more sophisticated way of it. Change-Id: I2896c76e012b9acbf1e725276ba9c0b74789fa54 --- nova/templates/bin/_cell-setup.sh.tpl | 2 +- nova/templates/bin/_db-sync.sh.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 nova/templates/bin/_cell-setup.sh.tpl mode change 100644 => 100755 nova/templates/bin/_db-sync.sh.tpl diff --git a/nova/templates/bin/_cell-setup.sh.tpl b/nova/templates/bin/_cell-setup.sh.tpl old mode 100644 new mode 100755 index abd1ffa5..4a701014 --- a/nova/templates/bin/_cell-setup.sh.tpl +++ b/nova/templates/bin/_cell-setup.sh.tpl @@ -18,7 +18,7 @@ limitations under the License. set -ex -NOVA_VERSION=$(nova-manage --version 2>&1) +NOVA_VERSION=$(nova-manage --version 2>&1 | grep -Eo '[0-9]+[.][0-9]+[.][0-9]+') # NOTE(portdirect): check if nova fully supports cells v2, and manage # accordingly. Support was complete in ocata (V14.x.x). diff --git a/nova/templates/bin/_db-sync.sh.tpl b/nova/templates/bin/_db-sync.sh.tpl old mode 100644 new mode 100755 index 4e38a746..ba657196 --- a/nova/templates/bin/_db-sync.sh.tpl +++ b/nova/templates/bin/_db-sync.sh.tpl @@ -17,7 +17,7 @@ limitations under the License. */}} set -ex -NOVA_VERSION=$(nova-manage --version 2>&1) +NOVA_VERSION=$(nova-manage --version 2>&1 | grep -Eo '[0-9]+[.][0-9]+[.][0-9]+') function manage_cells () { # NOTE(portdirect): check if nova fully supports cells v2, and manage