This is an internal-only fix, as it does not change any external APIs. A
bit of obfuscation was occurring in the
'template_utils.process_template_path' function call. First we try to
retrieve the template from a urllib call. If that fails, then we try to
make a request with the custom request_object function. If the
request_object function failed to retrieve the template as well, it
would report back 'ERROR: None'. I left both of the calls in this
function, but I made the first exception bubble up back to the caller,
since it is more helpful to the user.
The new error message should report back the following when a template
cannot be found:
<urlopen error [Errno 2] No such file or directory:
'/root/python-heatclient/test.yaml'>
Closed Bug: #1570229
Change-Id: I29e19172322c18559aa476744f7ff3530e689bd0
This change moved the required parameters so that it
is more easily visible to the user what is required.
Change-Id: I888960d2c83c96af80414c61dfd5faf38478f3fa
fnmatch is not thread safe in python <2.7.10, let's use the safe
one in oslo.utils
Change-Id: I489271f8fca94b1a1cb3ad30790042fe7468338c
ref: https://hg.python.org/cpython/rev/fe12c34c39eb
An assertion was added that compared the JSON dumped environment against
the string version of an environment file that was read in. The problem
is that there is no guarantee that dumped string will retain the same
order as the original string. This was seen in a failing CI run on an
unrelated change [1], manifesting itself as:
2016-03-30 20:12:57.278 | File
"/home/jenkins/workspace/gate-python-heatclient-python34/heatclient/tests/unit/test_template_utils.py",
line 413, in test_process_multiple_environments_and_files_tracker
2016-03-30 20:12:57.278 | files['file:///home/my/dir/env1.yaml'])
2016-03-30 20:12:57.278 | File
"/home/jenkins/workspace/gate-python-heatclient-python34/.tox/py34/lib/python3.4/site-packages/testtools/testcase.py",
line 362, in assertEqual
2016-03-30 20:12:57.278 | self.assertThat(observed, matcher,
message)
2016-03-30 20:12:57.279 | File
"/home/jenkins/workspace/gate-python-heatclient-python34/.tox/py34/lib/python3.4/site-packages/testtools/testcase.py",
line 447, in assertThat
2016-03-30 20:12:57.279 | raise mismatch_error
2016-03-30 20:12:57.279 | testtools.matchers._impl.MismatchError: !=:
2016-03-30 20:12:57.279 | reference = '{"resource_registry":
{"OS::Thingy1": "file:///home/b/a.yaml"}, "parameters": {"param1":
"value1"}}'
2016-03-30 20:12:57.279 | actual = '{"parameters": {"param1":
"value1"}, "resource_registry": {"OS::Thingy1":
"file:///home/b/a.yaml"}}'
This patch changes the assertion to parse the files version of the
environment into a dict for the comparison.
[1]
http://logs.openstack.org/34/270934/7/check/gate-python-heatclient-python34/deed567/console.html
Change-Id: I23fa0fddc9de933587e3b66c579dfd31ea49a2bd
For now heatclient unittests are showing some traceback
due to an issue in logging handler:
http://goo.gl/myPV87
The main point of this patch is to get rid of these
tracebacks. Some explanation:
- tracebacks were caused by logwarnings in some tests
trying to write to closed stream
- test_shell contain this shell_error method
which uses some magic with replacing sys.stderr with
six.StringIO(), calling shell.main which (among other things)
configures logging and then returning sys.stderr to previous
state and closing six.StringIO()
- but logger is still containing closed stream as
logging handler
- other tests do not configure logging so handler
remains the same
- with this replacing thing shell_error can return
sys.stderr.getvalue() but this return is never used in test now
So i think its safe to remove replacing magic.
Closes-Bug: #1567262
Change-Id: If4d1b3fb2c809b1d5d9e70ad63cf05c5ff0797ed
heatclient allows to provide client certificate/key using --os-key/cert
options but not using usual environment variables.
This change uses OS_KEY/OS_CERT environment variables as default values
for client certificate/key.
Closes-Bug: #1564930
Change-Id: Ie7a4dce2a9b0e498ee3b9f6cb36a8988ea3a13fc
The assertRegexpMatches function is deprecated and showing deprecation
warnings, which is clogging the logs for test jobs. This patch replaces
all occurances with assertRegex, the preferred method.
Change-Id: Id538fb7d34269036a32758b768735fbb88137ca1
When called without the required arguments, the allowed arguments are
output to the screen. The order of those arguments is dictated by when
they are added to the parser.
Before this change, -t (a required parameter) was at the start of the
list. This obfuscated the required parameter list when the help output
was displayed:
usage: openstack stack create [-h]
[-f
{html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--noindent]
[--prefix PREFIX] -t <template>
[-e <environment>] [--timeout <timeout>]
[--pre-create <resource>]
[--enable-rollback]
[--parameter <key=value>]
[--parameter-file <key=file>] [--wait]
[--tags <tag1,tag2...>] [--dry-run]
<stack-name>
Notice how the -t appears in the middle of the optional arguments. This
change moves it to the end so that it is more easily visible to the user
what is required:
usage: openstack stack create [-h]
[-f
{html,json,json,shell,table,value,yaml,yaml}]
[-c COLUMN] [--max-width <integer>]
[--noindent]
[--prefix PREFIX] [-e <environment>]
[--timeout <timeout>] [--pre-create
<resource>]
[--enable-rollback] [--parameter
<key=value>]
[--parameter-file <key=file>] [--wait]
[--tags <tag1,tag2...>] [--dry-run]
-t <template>
<stack-name>
Change-Id: I4e17650622dc8e206dc1aa39e4102f16429ac353
OpenStack client is not a runtime dependency of heatclient,
and having it in requirements just brings in many unneeded dependencies.
Move it to test-requirements so unit tests for osc plugin work.
Change-Id: I425b33d5e97e9328fe440f6b190bdd6b6cc813bf
Closes-Bug: #1562023
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
If we use new heatclient and heat with old RPC API (v < 1.19),
we doesn't have output_show/output_list endpoints. Use stack.get
in this case and get outputs from it.
Change-Id: I697ff2002fa123fce9a0f294b74c9fa0c92796a4
7627e1bae53747e1471caf632dfc1b6edf2e26cf introduced new code to add the
environment to the files mapping, so server side resolution of multiple
environments is possible.
However, the environment added is wrong when you're handling those with
relative paths inside, we must add the resolved version or the keys
don't map to keys in the files map, an you get an error when we try
to locate the file on the server.
Evidently we lack adequate functional test coverage of this, which can
be addressed via a heat patch, but I added a unit test illustrating
the problem.
Change-Id: I3bd2cd48623e4ad1b4067f4cefc7ddff30b9e88d
Closes-Bug: #1560106
Non-cli users of this library function may want to capture the event
log, so an 'out' argument has been added to this function.
Change-Id: Ic0c82d5a0c74c527f0a05afa197b8d5845dedfca
Closes-Bug: #1556677
This fixes the OSC plugin so that if region is specified or if the
interface is specified (public, internal, admin) then those will be
passed into the heat_client when instantiated. Without this the
client will pick the endpoint for the first region returned instead of
the one specified.
Closes-Bug: #1556263
Change-Id: I9c15719e7711c93e7fd076d38d66011bb20f988d