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
This commit is contained in:
sungil 2019-12-17 10:46:08 +00:00 committed by Chris Wedgwood
parent f6fe35d452
commit 620286117b
2 changed files with 2 additions and 2 deletions

2
nova/templates/bin/_cell-setup.sh.tpl Normal file → Executable file
View File

@ -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).

2
nova/templates/bin/_db-sync.sh.tpl Normal file → Executable file
View File

@ -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