From 99afd075241f344d33697ceef176b35e44fd1340 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Tue, 22 Oct 2013 18:03:06 +0000 Subject: [PATCH] Add api version detection to verify_tempest_config This commit adds glance api version discovery to verify_tempest_config.py. It will query the glance API to see which API versions are available and then compare that to what is in the config, pointing out any differences Partially Implements: blueprint config-verification Change-Id: Ie75f7f526d78b85a53ea4b0484e670d373d622ec --- tools/verify_tempest_config.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/verify_tempest_config.py b/tools/verify_tempest_config.py index 881a7b399e..1b5fe68cbd 100755 --- a/tools/verify_tempest_config.py +++ b/tools/verify_tempest_config.py @@ -31,6 +31,18 @@ NOVA_EXTENSIONS = { } +def verify_glance_api_versions(os): + # Check glance api versions + __, versions = os.image_client.get_versions() + if CONF.image_feature_enabled.api_v1 != ('v1.1' in versions or 'v1.0' in + versions): + print 'Config option image api_v1 should be change to: %s' % ( + not CONF.image_feature_enabled.api_v1) + if CONF.image_feature_enabled.api_v2 != ('v2.0' in versions): + print 'Config option image api_v2 should be change to: %s' % ( + not CONF.image_feature_enabled.api_v2) + + def verify_extensions(os): results = {} extensions_client = os.extensions_client @@ -57,6 +69,7 @@ def display_results(results): def main(argv): os = clients.ComputeAdminManager(interface='json') results = verify_extensions(os) + verify_glance_api_versions(os) display_results(results)