blob: b2e72c5bd7f94c86dc905a210a4dfdb71bc116bb [file] [log] [blame]
Matthew Treinish1f7b33d2013-10-21 18:07:02 +00001#!/usr/bin/env python
Matthew Treinish1f7b33d2013-10-21 18:07:02 +00002
3# Copyright 2013 IBM Corp.
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
16
Matthew Treinishf0971712014-04-11 20:08:53 +000017import argparse
Matthew Treinishf0971712014-04-11 20:08:53 +000018import os
Brant Knudson28de8d52016-03-18 13:50:02 -050019import re
Matthew Treinish1f7b33d2013-10-21 18:07:02 +000020import sys
David Patersone45aa842015-11-18 16:12:27 -080021import traceback
Matthew Treinish1f7b33d2013-10-21 18:07:02 +000022
David Patersone45aa842015-11-18 16:12:27 -080023from cliff import command
24from oslo_log import log as logging
Matthew Treinish21905512015-07-13 10:33:35 -040025from oslo_serialization import jsonutils as json
Matthew Treinishc795b9e2014-06-09 17:01:10 -040026from six import moves
Matthew Treinishf077dd22015-04-23 09:37:41 -040027from six.moves.urllib import parse as urlparse
Matthew Treinish4f30eb82014-01-07 21:04:49 +000028
Matthew Treinish1f7b33d2013-10-21 18:07:02 +000029from tempest import clients
Andrea Frittoli (andreaf)290b3e12015-10-08 10:25:02 +010030from tempest.common import credentials_factory as credentials
Matthew Treinish1f7b33d2013-10-21 18:07:02 +000031from tempest import config
Jordan Pittier00f25962016-03-18 17:10:07 +010032import tempest.lib.common.http
Matthew Treinish1f7b33d2013-10-21 18:07:02 +000033
34
Sean Dague86bd8422013-12-20 09:56:44 -050035CONF = config.CONF
David Kranzf20ac322014-05-02 16:46:15 -040036CONF_PARSER = None
Matthew Treinish1f7b33d2013-10-21 18:07:02 +000037
David Patersone45aa842015-11-18 16:12:27 -080038LOG = logging.getLogger(__name__)
39
Matthew Treinish1f7b33d2013-10-21 18:07:02 +000040
Matthew Treinishf0971712014-04-11 20:08:53 +000041def _get_config_file():
42 default_config_dir = os.path.join(os.path.abspath(
David Kranzf20ac322014-05-02 16:46:15 -040043 os.path.dirname(os.path.dirname(os.path.dirname(__file__)))), "etc")
Matthew Treinishf0971712014-04-11 20:08:53 +000044 default_config_file = "tempest.conf"
45
46 conf_dir = os.environ.get('TEMPEST_CONFIG_DIR', default_config_dir)
47 conf_file = os.environ.get('TEMPEST_CONFIG', default_config_file)
48 path = os.path.join(conf_dir, conf_file)
Sirushti Murugesan12dc9732016-07-13 22:49:17 +053049 fd = open(path, 'r+')
Matthew Treinishf0971712014-04-11 20:08:53 +000050 return fd
51
52
53def change_option(option, group, value):
David Kranzf20ac322014-05-02 16:46:15 -040054 if not CONF_PARSER.has_section(group):
55 CONF_PARSER.add_section(group)
56 CONF_PARSER.set(group, option, str(value))
Matthew Treinishf0971712014-04-11 20:08:53 +000057
58
59def print_and_or_update(option, group, value, update):
60 print('Config option %s in group %s should be changed to: %s'
61 % (option, group, value))
62 if update:
63 change_option(option, group, value)
64
65
David Kranz0df154d2015-06-02 17:02:27 -040066def contains_version(prefix, versions):
67 return any([x for x in versions if x.startswith(prefix)])
68
69
Matthew Treinishf0971712014-04-11 20:08:53 +000070def verify_glance_api_versions(os, update):
Matthew Treinish99afd072013-10-22 18:03:06 +000071 # Check glance api versions
Julien Danjou99518762016-09-19 17:58:25 +020072 _, versions = os.image_client.get_versions()
David Kranz0df154d2015-06-02 17:02:27 -040073 if CONF.image_feature_enabled.api_v1 != contains_version('v1.', versions):
Nikita Gerasimov35fbdc12015-08-07 19:58:24 +030074 print_and_or_update('api_v1', 'image-feature-enabled',
Matthew Treinishf0971712014-04-11 20:08:53 +000075 not CONF.image_feature_enabled.api_v1, update)
David Kranz0df154d2015-06-02 17:02:27 -040076 if CONF.image_feature_enabled.api_v2 != contains_version('v2.', versions):
Nikita Gerasimov35fbdc12015-08-07 19:58:24 +030077 print_and_or_update('api_v2', 'image-feature-enabled',
Matthew Treinishf0971712014-04-11 20:08:53 +000078 not CONF.image_feature_enabled.api_v2, update)
Matthew Treinish99afd072013-10-22 18:03:06 +000079
80
Brant Knudson28de8d52016-03-18 13:50:02 -050081def _remove_version_project(url_path):
82 # The regex matches strings like /v2.0, /v3/, /v2.1/project-id/
83 return re.sub(r'/v\d+(\.\d+)?(/[^/]+)?', '', url_path)
84
85
Matthew Treinish9b896242014-04-23 21:25:27 +000086def _get_unversioned_endpoint(base_url):
87 endpoint_parts = urlparse.urlparse(base_url)
Brant Knudson28de8d52016-03-18 13:50:02 -050088 new_path = _remove_version_project(endpoint_parts.path)
89 endpoint_parts = endpoint_parts._replace(path=new_path)
90 endpoint = urlparse.urlunparse(endpoint_parts)
Matthew Treinish9b896242014-04-23 21:25:27 +000091 return endpoint
92
93
Matthew Treinish864fe072014-03-02 03:47:26 +000094def _get_api_versions(os, service):
95 client_dict = {
96 'nova': os.servers_client,
97 'keystone': os.identity_client,
Matthew Treinish2e439632014-03-05 21:53:33 +000098 'cinder': os.volumes_client,
Matthew Treinish864fe072014-03-02 03:47:26 +000099 }
Brant Knudson28de8d52016-03-18 13:50:02 -0500100 if service != 'keystone':
101 # Since keystone may be listening on a path, do not remove the path.
102 client_dict[service].skip_path()
Matthew Treinish9b896242014-04-23 21:25:27 +0000103 endpoint = _get_unversioned_endpoint(client_dict[service].base_url)
Jordan Pittier00f25962016-03-18 17:10:07 +0100104
105 http = tempest.lib.common.http.ClosingHttp(
Daniel Melladocad3f3d2016-08-19 14:17:16 +0000106 CONF.identity.disable_ssl_certificate_validation,
107 CONF.identity.ca_certificates_file)
Jordan Pittier00f25962016-03-18 17:10:07 +0100108
109 __, body = http.request(endpoint, 'GET')
Matthew Treinish864fe072014-03-02 03:47:26 +0000110 client_dict[service].reset_path()
Brant Knudson5a59f872016-03-18 13:07:00 -0500111 try:
112 body = json.loads(body)
113 except ValueError:
114 LOG.error(
115 'Failed to get a JSON response from unversioned endpoint %s '
116 '(versioned endpoint was %s). Response is:\n%s',
117 endpoint, client_dict[service].base_url, body[:100])
118 raise
Matthew Treinish864fe072014-03-02 03:47:26 +0000119 if service == 'keystone':
120 versions = map(lambda x: x['id'], body['versions']['values'])
121 else:
122 versions = map(lambda x: x['id'], body['versions'])
Matthew Treinish09487242015-05-10 12:43:58 -0400123 return list(versions)
Matthew Treinish864fe072014-03-02 03:47:26 +0000124
125
Matthew Treinishf0971712014-04-11 20:08:53 +0000126def verify_keystone_api_versions(os, update):
Matthew Treinish864fe072014-03-02 03:47:26 +0000127 # Check keystone api versions
128 versions = _get_api_versions(os, 'keystone')
David Kranz0df154d2015-06-02 17:02:27 -0400129 if (CONF.identity_feature_enabled.api_v2 !=
130 contains_version('v2.', versions)):
Nikita Gerasimov35fbdc12015-08-07 19:58:24 +0300131 print_and_or_update('api_v2', 'identity-feature-enabled',
Matthew Treinishf0971712014-04-11 20:08:53 +0000132 not CONF.identity_feature_enabled.api_v2, update)
David Kranz0df154d2015-06-02 17:02:27 -0400133 if (CONF.identity_feature_enabled.api_v3 !=
134 contains_version('v3.', versions)):
Nikita Gerasimov35fbdc12015-08-07 19:58:24 +0300135 print_and_or_update('api_v3', 'identity-feature-enabled',
Matthew Treinishf0971712014-04-11 20:08:53 +0000136 not CONF.identity_feature_enabled.api_v3, update)
Matthew Treinish864fe072014-03-02 03:47:26 +0000137
138
Matthew Treinishf0971712014-04-11 20:08:53 +0000139def verify_cinder_api_versions(os, update):
Matthew Treinish2e439632014-03-05 21:53:33 +0000140 # Check cinder api versions
141 versions = _get_api_versions(os, 'cinder')
David Kranz0df154d2015-06-02 17:02:27 -0400142 if (CONF.volume_feature_enabled.api_v1 !=
143 contains_version('v1.', versions)):
Nikita Gerasimov35fbdc12015-08-07 19:58:24 +0300144 print_and_or_update('api_v1', 'volume-feature-enabled',
Matthew Treinishf0971712014-04-11 20:08:53 +0000145 not CONF.volume_feature_enabled.api_v1, update)
David Kranz0df154d2015-06-02 17:02:27 -0400146 if (CONF.volume_feature_enabled.api_v2 !=
147 contains_version('v2.', versions)):
Nikita Gerasimov35fbdc12015-08-07 19:58:24 +0300148 print_and_or_update('api_v2', 'volume-feature-enabled',
Matthew Treinishf0971712014-04-11 20:08:53 +0000149 not CONF.volume_feature_enabled.api_v2, update)
Nikita Gerasimov3b169cc2016-08-10 17:10:42 +0300150 if (CONF.volume_feature_enabled.api_v3 !=
151 contains_version('v3.', versions)):
152 print_and_or_update('api_v3', 'volume-feature-enabled',
153 not CONF.volume_feature_enabled.api_v3, update)
Matthew Treinish2e439632014-03-05 21:53:33 +0000154
155
Adam Gandelman03af5562014-10-07 12:22:48 -0700156def verify_api_versions(os, service, update):
157 verify = {
158 'cinder': verify_cinder_api_versions,
159 'glance': verify_glance_api_versions,
160 'keystone': verify_keystone_api_versions,
Adam Gandelman03af5562014-10-07 12:22:48 -0700161 }
162 if service not in verify:
163 return
164 verify[service](os, update)
165
166
Matthew Treinish8b006d22014-01-07 15:37:20 +0000167def get_extension_client(os, service):
168 extensions_client = {
169 'nova': os.extensions_client,
Matthew Treinish8b006d22014-01-07 15:37:20 +0000170 'cinder': os.volumes_extension_client,
Ken'ichi Ohmichi52bb8122016-01-26 01:43:06 +0000171 'neutron': os.network_extensions_client,
Matthew Treinishc0120ba2014-01-31 20:10:19 +0000172 'swift': os.account_client,
Matthew Treinish8b006d22014-01-07 15:37:20 +0000173 }
Ivan Kolodyazhnybcfc32e2015-08-06 13:31:36 +0300174 # NOTE (e0ne): Use Cinder API v2 by default because v1 is deprecated
175 if CONF.volume_feature_enabled.api_v2:
176 extensions_client['cinder'] = os.volumes_v2_extension_client
177 else:
178 extensions_client['cinder'] = os.volumes_extension_client
179
Matthew Treinish8b006d22014-01-07 15:37:20 +0000180 if service not in extensions_client:
181 print('No tempest extensions client for %s' % service)
caoyueab333022016-01-25 16:45:21 +0800182 sys.exit(1)
Matthew Treinish8b006d22014-01-07 15:37:20 +0000183 return extensions_client[service]
184
185
186def get_enabled_extensions(service):
187 extensions_options = {
188 'nova': CONF.compute_feature_enabled.api_extensions,
Matthew Treinish8b006d22014-01-07 15:37:20 +0000189 'cinder': CONF.volume_feature_enabled.api_extensions,
Matthew Treinish8c6706d2014-01-07 19:28:18 +0000190 'neutron': CONF.network_feature_enabled.api_extensions,
Matthew Treinishc0120ba2014-01-31 20:10:19 +0000191 'swift': CONF.object_storage_feature_enabled.discoverable_apis,
Matthew Treinish8b006d22014-01-07 15:37:20 +0000192 }
193 if service not in extensions_options:
194 print('No supported extensions list option for %s' % service)
caoyueab333022016-01-25 16:45:21 +0800195 sys.exit(1)
Matthew Treinish8b006d22014-01-07 15:37:20 +0000196 return extensions_options[service]
197
198
199def verify_extensions(os, service, results):
200 extensions_client = get_extension_client(os, service)
David Kranz5cf4ba42015-02-10 14:00:50 -0500201 if service != 'swift':
David Kranz34e88122014-12-11 15:24:05 -0500202 resp = extensions_client.list_extensions()
203 else:
204 __, resp = extensions_client.list_extensions()
Matthew Treinish54176ce2014-12-08 21:28:05 +0000205 # For Nova, Cinder and Neutron we use the alias name rather than the
206 # 'name' field because the alias is considered to be the canonical
207 # name.
Matthew Treinish8b006d22014-01-07 15:37:20 +0000208 if isinstance(resp, dict):
Matthew Treinish54176ce2014-12-08 21:28:05 +0000209 if service == 'swift':
Matthew Treinishc0120ba2014-01-31 20:10:19 +0000210 # Remove Swift general information from extensions list
211 resp.pop('swift')
212 extensions = resp.keys()
Matthew Treinish8c6706d2014-01-07 19:28:18 +0000213 else:
Matthew Treinish54176ce2014-12-08 21:28:05 +0000214 extensions = map(lambda x: x['alias'], resp['extensions'])
Matthew Treinish8c6706d2014-01-07 19:28:18 +0000215
Matthew Treinish8b006d22014-01-07 15:37:20 +0000216 else:
Matthew Treinish54176ce2014-12-08 21:28:05 +0000217 extensions = map(lambda x: x['alias'], resp)
Matthew Treinish09487242015-05-10 12:43:58 -0400218 extensions = list(extensions)
Matthew Treinish8b006d22014-01-07 15:37:20 +0000219 if not results.get(service):
220 results[service] = {}
221 extensions_opt = get_enabled_extensions(service)
222 if extensions_opt[0] == 'all':
Matthew Treinishf0971712014-04-11 20:08:53 +0000223 results[service]['extensions'] = extensions
Matthew Treinish8b006d22014-01-07 15:37:20 +0000224 return results
225 # Verify that all configured extensions are actually enabled
226 for extension in extensions_opt:
227 results[service][extension] = extension in extensions
228 # Verify that there aren't additional extensions enabled that aren't
229 # specified in the config list
230 for extension in extensions:
231 if extension not in extensions_opt:
232 results[service][extension] = False
Matthew Treinish1f7b33d2013-10-21 18:07:02 +0000233 return results
234
235
Matthew Treinishf0971712014-04-11 20:08:53 +0000236def display_results(results, update, replace):
237 update_dict = {
238 'swift': 'object-storage-feature-enabled',
239 'nova': 'compute-feature-enabled',
Matthew Treinishf0971712014-04-11 20:08:53 +0000240 'cinder': 'volume-feature-enabled',
241 'neutron': 'network-feature-enabled',
242 }
Matthew Treinish8b006d22014-01-07 15:37:20 +0000243 for service in results:
244 # If all extensions are specified as being enabled there is no way to
245 # verify this so we just assume this to be true
246 if results[service].get('extensions'):
Matthew Treinishf0971712014-04-11 20:08:53 +0000247 if replace:
248 output_list = results[service].get('extensions')
249 else:
250 output_list = ['all']
251 else:
252 extension_list = get_enabled_extensions(service)
253 output_list = []
254 for extension in results[service]:
255 if not results[service][extension]:
256 if extension in extension_list:
257 print("%s extension: %s should not be included in the "
258 "list of enabled extensions" % (service,
259 extension))
260 else:
261 print("%s extension: %s should be included in the list"
262 " of enabled extensions" % (service, extension))
263 output_list.append(extension)
Matthew Treinish8b006d22014-01-07 15:37:20 +0000264 else:
Matthew Treinishf0971712014-04-11 20:08:53 +0000265 output_list.append(extension)
266 if update:
267 # Sort List
268 output_list.sort()
269 # Convert list to a string
270 output_string = ', '.join(output_list)
271 if service == 'swift':
272 change_option('discoverable_apis', update_dict[service],
273 output_string)
Matthew Treinishf0971712014-04-11 20:08:53 +0000274 else:
275 change_option('api_extensions', update_dict[service],
276 output_string)
Matthew Treinish1f7b33d2013-10-21 18:07:02 +0000277
278
Matthew Treinishf0971712014-04-11 20:08:53 +0000279def check_service_availability(os, update):
Matthew Treinish221bd7f2014-02-07 21:16:09 +0000280 services = []
281 avail_services = []
282 codename_match = {
283 'volume': 'cinder',
284 'network': 'neutron',
285 'image': 'glance',
286 'object_storage': 'swift',
287 'compute': 'nova',
288 'orchestration': 'heat',
Matthew Treinish42d50f62014-04-11 19:47:13 +0000289 'data_processing': 'sahara',
Matthew Treinish221bd7f2014-02-07 21:16:09 +0000290 'baremetal': 'ironic',
Matthew Treinish42d50f62014-04-11 19:47:13 +0000291 'identity': 'keystone',
Matthew Treinish221bd7f2014-02-07 21:16:09 +0000292 }
293 # Get catalog list for endpoints to use for validation
David Kranz45714082015-04-01 14:47:33 -0400294 _token, auth_data = os.auth_provider.get_auth()
David Kranz799eee12015-04-08 11:18:19 -0400295 if os.auth_version == 'v2':
296 catalog_key = 'serviceCatalog'
297 else:
298 catalog_key = 'catalog'
299 for entry in auth_data[catalog_key]:
David Kranz45714082015-04-01 14:47:33 -0400300 services.append(entry['type'])
Matthew Treinish221bd7f2014-02-07 21:16:09 +0000301 # Pull all catalog types from config file and compare against endpoint list
302 for cfgname in dir(CONF._config):
303 cfg = getattr(CONF, cfgname)
304 catalog_type = getattr(cfg, 'catalog_type', None)
305 if not catalog_type:
306 continue
307 else:
308 if cfgname == 'identity':
309 # Keystone is a required service for tempest
310 continue
311 if catalog_type not in services:
312 if getattr(CONF.service_available, codename_match[cfgname]):
313 print('Endpoint type %s not found either disable service '
314 '%s or fix the catalog_type in the config file' % (
Matthew Treinish96e9e882014-06-09 18:37:19 -0400315 catalog_type, codename_match[cfgname]))
Matthew Treinishf0971712014-04-11 20:08:53 +0000316 if update:
317 change_option(codename_match[cfgname],
318 'service_available', False)
Matthew Treinish221bd7f2014-02-07 21:16:09 +0000319 else:
320 if not getattr(CONF.service_available,
321 codename_match[cfgname]):
322 print('Endpoint type %s is available, service %s should be'
323 ' set as available in the config file.' % (
Matthew Treinish96e9e882014-06-09 18:37:19 -0400324 catalog_type, codename_match[cfgname]))
Matthew Treinishf0971712014-04-11 20:08:53 +0000325 if update:
326 change_option(codename_match[cfgname],
327 'service_available', True)
David Kranzf20ac322014-05-02 16:46:15 -0400328 # If we are going to enable this we should allow
329 # extension checks.
330 avail_services.append(codename_match[cfgname])
Matthew Treinish221bd7f2014-02-07 21:16:09 +0000331 else:
332 avail_services.append(codename_match[cfgname])
333 return avail_services
Matthew Treinishd44fe032014-01-31 20:07:24 +0000334
335
David Patersone45aa842015-11-18 16:12:27 -0800336def _parser_add_args(parser):
Matthew Treinishf0971712014-04-11 20:08:53 +0000337 parser.add_argument('-u', '--update', action='store_true',
338 help='Update the config file with results from api '
339 'queries. This assumes whatever is set in the '
340 'config file is incorrect. In the case of '
341 'endpoint checks where it could either be the '
342 'incorrect catalog type or the service available '
343 'option the service available option is assumed '
344 'to be incorrect and is thus changed')
345 parser.add_argument('-o', '--output',
346 help="Output file to write an updated config file to. "
347 "This has to be a separate file from the "
348 "original config file. If one isn't specified "
349 "with -u the new config file will be printed to "
350 "STDOUT")
351 parser.add_argument('-r', '--replace-ext', action='store_true',
352 help="If specified the all option will be replaced "
353 "with a full list of extensions")
Matthew Treinishf0971712014-04-11 20:08:53 +0000354
355
David Patersone45aa842015-11-18 16:12:27 -0800356def parse_args():
357 parser = argparse.ArgumentParser()
358 _parser_add_args(parser)
359 opts = parser.parse_args()
360 return opts
361
362
363def main(opts=None):
Matthew Treinish8b006d22014-01-07 15:37:20 +0000364 print('Running config verification...')
David Patersone45aa842015-11-18 16:12:27 -0800365 if opts is None:
366 print("Use of: 'verify-tempest-config' is deprecated, "
367 "please use: 'tempest verify-config'")
368 opts = parse_args()
Matthew Treinishf0971712014-04-11 20:08:53 +0000369 update = opts.update
370 replace = opts.replace_ext
David Kranzf20ac322014-05-02 16:46:15 -0400371 global CONF_PARSER
372
Matthew Treinishf0971712014-04-11 20:08:53 +0000373 if update:
David Kranzf20ac322014-05-02 16:46:15 -0400374 conf_file = _get_config_file()
Janonymous8254a3f2016-09-15 10:38:48 +0530375 CONF_PARSER = moves.configparser.ConfigParser()
David Kranzf20ac322014-05-02 16:46:15 -0400376 CONF_PARSER.optionxform = str
377 CONF_PARSER.readfp(conf_file)
Brad Behle43e4fd82016-04-13 17:15:21 -0500378
379 # Indicate not to create network resources as part of getting credentials
380 net_resources = {
381 'network': False,
382 'router': False,
383 'subnet': False,
384 'dhcp': False
385 }
386 icreds = credentials.get_credentials_provider(
387 'verify_tempest_config', network_resources=net_resources)
David Kranz5fcac942015-05-08 17:43:45 -0400388 try:
Andrea Frittoli (andreaf)848c4a12016-06-09 11:09:02 +0100389 os = clients.Manager(icreds.get_primary_creds().credentials)
David Kranz5fcac942015-05-08 17:43:45 -0400390 services = check_service_availability(os, update)
391 results = {}
392 for service in ['nova', 'cinder', 'neutron', 'swift']:
393 if service not in services:
394 continue
395 results = verify_extensions(os, service, results)
Adam Gandelman03af5562014-10-07 12:22:48 -0700396
David Kranz5fcac942015-05-08 17:43:45 -0400397 # Verify API versions of all services in the keystone catalog and
398 # keystone itself.
399 services.append('keystone')
400 for service in services:
401 verify_api_versions(os, service, update)
Adam Gandelman03af5562014-10-07 12:22:48 -0700402
David Kranz5fcac942015-05-08 17:43:45 -0400403 display_results(results, update, replace)
404 if update:
405 conf_file.close()
zhang.leia4b1cef2016-03-01 10:50:01 +0800406 if opts.output:
407 with open(opts.output, 'w+') as outfile:
408 CONF_PARSER.write(outfile)
David Kranz5fcac942015-05-08 17:43:45 -0400409 finally:
Andrea Frittoli (andreaf)17209bb2015-05-22 10:16:57 -0700410 icreds.clear_creds()
Matthew Treinish1f7b33d2013-10-21 18:07:02 +0000411
412
David Patersone45aa842015-11-18 16:12:27 -0800413class TempestVerifyConfig(command.Command):
414 """Verify your current tempest configuration"""
415
416 def get_parser(self, prog_name):
417 parser = super(TempestVerifyConfig, self).get_parser(prog_name)
418 _parser_add_args(parser)
419 return parser
420
421 def take_action(self, parsed_args):
422 try:
Masayuki Igawa92629432016-06-09 12:28:09 +0900423 main(parsed_args)
David Patersone45aa842015-11-18 16:12:27 -0800424 except Exception:
425 LOG.exception("Failure verifying configuration.")
426 traceback.print_exc()
427 raise
David Patersone45aa842015-11-18 16:12:27 -0800428
Matthew Treinish1f7b33d2013-10-21 18:07:02 +0000429if __name__ == "__main__":
Matthew Treinishf8b816a2014-04-23 20:35:49 +0000430 main()