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/common | |
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/common')
-rw-r--r-- | heatclient/common/http.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/heatclient/common/http.py b/heatclient/common/http.py index 4b46c71..8a799b6 100644 --- a/heatclient/common/http.py +++ b/heatclient/common/http.py @@ -39,6 +39,19 @@ SENSITIVE_HEADERS = ('X-Auth-Token',) osprofiler_web = importutils.try_import("osprofiler.web") +def authenticated_fetcher(hc): + """A wrapper around the heat client object to fetch a template.""" + + def _do(*args, **kwargs): + if isinstance(hc.http_client, 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 get_system_ca_file(): """Return path to system default CA file.""" # Standard CA file locations for Debian/Ubuntu, RedHat/Fedora, |