blob: 45c97714cd4d0b23c94153c8ac814eede81656bf [file] [log] [blame]
Mohammed Naserf3f59a72023-01-15 21:02:04 -05001#!/bin/bash
2
3{{/*
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/}}
16
17set -ex
18
19NOVA_VERSION=$(nova-manage --version 2>&1 | grep -Eo '[0-9]+[.][0-9]+[.][0-9]+')
20
21# NOTE(portdirect): check if nova fully supports cells v2, and manage
22# accordingly. Support was complete in ocata (V14.x.x).
23
24if [ "${NOVA_VERSION%%.*}" -gt "14" ]; then
25 nova-manage cell_v2 discover_hosts --verbose
26fi