diff options
| author | Mark Vanderwiel <vanderwl@us.ibm.com> | 2016-03-04 14:36:13 -0600 |
|---|---|---|
| committer | Mark Vanderwiel <vanderwl@us.ibm.com> | 2016-03-24 10:26:52 -0500 |
| commit | 1d4c407fc53ed2b57377095f0f5d99079afcf51f (patch) | |
| tree | 7a0488795ad94ef57cc30441378fc93cbb3903cc /heatclient/v1 | |
| parent | f13d36ae0114e159663ea2a3fa07260df9d9407d (diff) | |
| download | python-heatclient-1d4c407fc53ed2b57377095f0f5d99079afcf51f.tar.gz | |
OSC plugin for orchestration template validate
This change implements "openstack orchestration template validate" command
Based from the existing heat commands:
heat template-validate
This is different from the stack create/update --dry-run
which used the preview api, this uses the validate api.
Change-Id: Icf5794ad6bb35574a060f095d7ef10e6a46ca2fe
Blueprint: heat-support-python-openstackclient
Diffstat (limited to 'heatclient/v1')
| -rw-r--r-- | heatclient/v1/shell.py | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/heatclient/v1/shell.py b/heatclient/v1/shell.py index 35540d8..c89526f 100644 --- a/heatclient/v1/shell.py +++ b/heatclient/v1/shell.py @@ -39,19 +39,6 @@ import heatclient.exc as exc logger = logging.getLogger(__name__) -def _authenticated_fetcher(hc): - """A wrapper around the heat client object to fetch a template.""" - - def _do(*args, **kwargs): - if isinstance(hc.http_client, http.SessionClient): - method, url = args - return hc.http_client.request(url, method, **kwargs).content - else: - return hc.http_client.raw_request(*args, **kwargs).content - - return _do - - def show_deprecated(deprecated, recommended): logger.warning(_LW('"%(old)s" is deprecated, ' 'please use "%(new)s" instead'), @@ -114,7 +101,7 @@ def do_stack_create(hc, args): args.template_file, args.template_url, args.template_object, - _authenticated_fetcher(hc)) + http.authenticated_fetcher(hc)) env_files_list = [] env_files, env = template_utils.process_multiple_environments_and_files( env_paths=args.environment_file, env_list_tracker=env_files_list) @@ -269,7 +256,7 @@ def do_stack_preview(hc, args): args.template_file, args.template_url, args.template_object, - _authenticated_fetcher(hc)) + http.authenticated_fetcher(hc)) env_files_list = [] env_files, env = template_utils.process_multiple_environments_and_files( env_paths=args.environment_file, env_list_tracker=env_files_list) @@ -518,7 +505,7 @@ def do_stack_update(hc, args): args.template_file, args.template_url, args.template_object, - _authenticated_fetcher(hc), + http.authenticated_fetcher(hc), existing=args.existing) env_files_list = [] env_files, env = template_utils.process_multiple_environments_and_files( @@ -906,12 +893,14 @@ def do_template_show(hc, args): help=_('List of heat errors to ignore.')) def do_template_validate(hc, args): """Validate a template with parameters.""" + show_deprecated('heat template-validate', + 'openstack orchestration template validate') tpl_files, template = template_utils.get_template_contents( args.template_file, args.template_url, args.template_object, - _authenticated_fetcher(hc)) + http.authenticated_fetcher(hc)) env_files_list = [] env_files, env = template_utils.process_multiple_environments_and_files( |
