Check required Gnocchi version is installed
Change-Id: I301511279c1d49736027e51274c8740935e154b0
This commit is contained in:
parent
24a0b74ee6
commit
02c99b1867
@ -11,6 +11,8 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
from distutils import version
|
||||||
|
|
||||||
from gnocchiclient import client
|
from gnocchiclient import client
|
||||||
from gnocchiclient import exceptions as gnocchi_exc
|
from gnocchiclient import exceptions as gnocchi_exc
|
||||||
import keystoneauth1.session
|
import keystoneauth1.session
|
||||||
@ -184,9 +186,19 @@ resources_update_operations = [
|
|||||||
}]},
|
}]},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# NOTE(sileht): We use LooseVersion because pbr can generate invalid
|
||||||
|
# StrictVersion like 9.0.1.dev226
|
||||||
|
REQUIRED_VERSION = version.LooseVersion("4.0.0")
|
||||||
|
|
||||||
|
|
||||||
def upgrade_resource_types(conf):
|
def upgrade_resource_types(conf):
|
||||||
gnocchi = get_gnocchiclient(conf)
|
gnocchi = get_gnocchiclient(conf)
|
||||||
|
|
||||||
|
gnocchi_version = version.LooseVersion(gnocchi.build.get())
|
||||||
|
if gnocchi_version < REQUIRED_VERSION:
|
||||||
|
raise Exception("required gnocchi version is %s, got %s",
|
||||||
|
REQUIRED_VERSION, gnocchi_version)
|
||||||
|
|
||||||
for name, attributes in resources_initial.items():
|
for name, attributes in resources_initial.items():
|
||||||
try:
|
try:
|
||||||
gnocchi.resource_type.get(name=name)
|
gnocchi.resource_type.get(name=name)
|
||||||
|
@ -33,7 +33,7 @@ data_files =
|
|||||||
[extras]
|
[extras]
|
||||||
gnocchi =
|
gnocchi =
|
||||||
oslo.cache>=1.5.0 # Apache-2.0
|
oslo.cache>=1.5.0 # Apache-2.0
|
||||||
gnocchiclient>=4.0.0 # Apache-2.0
|
gnocchiclient>=7.0.0 # Apache-2.0
|
||||||
zaqar =
|
zaqar =
|
||||||
python-zaqarclient>=1.0.0 # Apache-2.0
|
python-zaqarclient>=1.0.0 # Apache-2.0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user