1010 Commits

Author SHA1 Message Date
OpenStack Proposal Bot
096f06a25e Updated from global requirements
Change-Id: Ia37b068548e2c79e288c1a8d02076cbc1bae32fd
2016-05-30 00:38:54 +00:00
OpenStack Proposal Bot
8f97406270 Updated from global requirements
Change-Id: I10dbe65c194a9343b7032b465d2ddd112fdc1658
2016-05-26 17:04:50 +00:00
Steve Baker
7299dd2fde Clean up osc fakes and mocks
The original fakes included a lot of unneeded pasted code from
openstackclient. This change replaces the client with a single
MagicMock, and deletes unused fakes classes.

Since the base client is a magic mock, a significant amount of mock
object creation has been replaced with the magic equivalent.

This change actually revealed a faulty test,
test_deployment_config_delete_failed should be asserting that deleting
the derived config is best-effort and does not raise an error.

Change-Id: I11be97603b2d42ea70dde7d936e11d15e7f5709e
2016-05-26 11:46:13 +12:00
Thomas Herve
bcbbbc9e2c Fix typo
Fix typo WRT physical_resource_id in help messages.

Change-Id: Ica89b13cc9cd2b355cf65c7ccb329518e5c745bd
2016-05-23 11:02:01 +02:00
Jenkins
3d5ff1a663 Merge "Register a log formatter for stack event list" 2016-05-23 03:55:11 +00:00
Jenkins
c94a711ca8 Merge "Allow redirects to use location from response" 2016-05-20 07:57:07 +00:00
rabi
0e0959eb7c Remove redundant auth discovery
This removes the redundant auth discovery
and use generic auth plugins.

Change-Id: Ibf96a188363467e74879018e31c0d8729c6cdeee
2016-05-18 19:51:41 +05:30
Jenkins
f8a974378b Merge "switch to keystoneauth" 2016-05-18 07:39:00 +00:00
Steve Martinelli
2d32a08a23 switch to keystoneauth
move heatclient to keystoneauth as keystoneclient's auth session,
plugins and adapter code has been deprecated [1].

[1] http://docs.openstack.org/releasenotes/python-keystoneclient/mitaka.html#deprecation-notes

Change-Id: Iedd7ceb97d39ab3ecccf8786aad8b5f45d15175e
2016-05-18 02:08:32 -04:00
OpenStack Proposal Bot
f9ab90df11 Updated from global requirements
Change-Id: I5b37ce2ca1d5c3f366258f321b78b154f01f1bc3
2016-05-17 14:09:37 +00:00
rabi
01b7781f68 Allow redirects to use location from response
This allows redirects to use fully qualified location
from response header and removes the check to prohibit
redirects to different project(required for super admin
actions).

Change-Id: I46876189e96375922c4f0bf30452b7c4980fe39c
2016-05-17 14:55:55 +05:30
OpenStack Proposal Bot
db07e2139e Updated from global requirements
Change-Id: Ie4583cd6a7103e6fbb5b8376446a64963bcaa7d9
2016-05-17 03:02:27 +00:00
Jenkins
7db039b75d Merge "Moved required parameter for visibility" 2016-05-11 11:29:53 +00:00
Jenkins
51a24f1537 Merge "use thread safe fnmatch" 2016-05-11 06:52:26 +00:00
Jenkins
b9c04918e1 Merge "Fix obscure error message when no template given to OSC" 2016-05-10 05:49:13 +00:00
OpenStack Proposal Bot
b619758947 Updated from global requirements
Change-Id: Ibfba88c747fc539e836428b4ca598116281e596c
2016-05-06 22:22:15 +00:00
Jenkins
e6b044a11c Merge "Updated from global requirements" 2016-05-04 14:35:40 +00:00
Jenkins
c222fc5dd3 Merge "Fixed fragile assertion in test_template_utils" 2016-05-04 14:32:40 +00:00
OpenStack Proposal Bot
d9b3766fa3 Updated from global requirements
Change-Id: I5c88fb95594630aea186924e49574f6ada14cb6d
2016-05-03 16:02:40 +00:00
Jenkins
0e6a81f962 Merge "Replace tempest-lib with tempest.lib" 2016-05-03 13:48:33 +00:00
Paul Breaux
f5d4721e5f Fix obscure error message when no template given to OSC
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
2016-05-01 21:58:24 -06:00
Jenkins
0586d59b5b Merge "Move OpenStack client to test-requirements" 2016-04-29 17:11:46 +00:00
Daniel Gonzalez
38c29b3bbc Replace tempest-lib with tempest.lib
tempest-lib is deprecated, replace it with tempest.lib.

Closes-Bug: #1553047
Change-Id: Icc17203a83513a1770dc845978550ff856dd8594
2016-04-28 14:49:16 -05:00
xiaolihope
d60ad183ab Moved required parameter for visibility
This change moved the required parameters so that it
is more easily visible to the user what is required.

Change-Id: I888960d2c83c96af80414c61dfd5faf38478f3fa
2016-04-26 10:44:11 +08:00
ZhiQiang Fan
38c0684a6b use thread safe fnmatch
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
2016-04-21 12:22:47 +08:00
Jay Dobies
a503bfeff0 OpenStack client plugin for environment show
Adds the "openstack stack environment show" command.

Depends-On: I7e3577dfc854018245d79afdfee45a9d250d73a7
Change-Id: I7ef4858738964198bc4614122be4bab8f49b1b5f
Implements: blueprint environment-show
2016-04-18 13:32:05 -04:00
Jay Dobies
3f340cd818 Add client library support for retrieving a stack's environment
Change-Id: I84aa5ed9dc2b8aee089de3b1e1810552b8f2dd96
Depends-On: I7e3577dfc854018245d79afdfee45a9d250d73a7
Implements: blueprint environment-show
2016-04-18 13:31:21 -04:00
huangtianhua
726415e43c Support "--pre-delete" argument for hook-clear
This changes:
1. Add "--pre-delete" argument for cmd "heat hook-clear" to
clear pre-delete hooks.
2. Add "--pre-delete" argument for osc cmd
"openstack stack hook clear" to clear pre-delete hooks.
3. Support to poll pre-delete hooks for "heat hook-poll" and
"openstack stack hook poll".

Change-Id: Ic5a6e1b7588e3f9ad49eaaf8085f18ec74fc629e
Closes-Bug: #1567814
2016-04-16 14:58:35 +08:00
Jenkins
4763d5d8fc Merge "Moved -t parameter for visibility" 2016-04-15 03:37:34 +00:00
Jenkins
9ac51b1386 Merge "Add basic read-only function test for template validate" 2016-04-14 22:00:46 +00:00
Jay Dobies
3fb66ab044 Fixed fragile assertion in test_template_utils
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
2016-04-14 13:04:52 -04:00
Jenkins
4c12fb4bd6 Merge "Fix logging issue in heatclient tests" 2016-04-13 14:40:44 +00:00
OpenStack Proposal Bot
0f62cb0ba6 Updated from global requirements
Change-Id: Id0b6e1a9ee5ee01a3b73d4192cb6cf073c06aa6c
2016-04-13 12:48:07 +00:00
OpenStack Proposal Bot
065fee7a72 Updated from global requirements
Change-Id: I172d7556e0a51b4c42c3b762ccd52ee85b0be1ea
2016-04-08 00:32:49 +00:00
Dmitriy Uvarenkov
ce23b86db5 Fix logging issue in heatclient tests
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
2016-04-07 10:53:55 +03:00
Jenkins
51feb0fddb Merge "Support OS_KEY/OS_CERT environment variables" 2016-04-06 17:45:21 +00:00
Mark Vanderwiel
919d066f62 Add basic read-only function test for template validate
Add basic functional test for
"openstack orchestration template validate".

Change-Id: I8c0bf3a27a266eaa140f033ecf32d97d0f2f1ee7
2016-04-06 09:53:38 -05:00
Jenkins
00a95ad4f6 Merge "Basic set of stack functional tests for openstack client" 2016-04-06 05:48:21 +00:00
Jenkins
cc4a611b7b Merge "OSC plugin should be region/interface aware" 2016-04-04 09:58:36 +00:00
cedric.brandily
17b4b16ace Support OS_KEY/OS_CERT environment variables
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
2016-04-01 16:19:45 +02:00
Bryan Jones
ab4ac5dbc1 Replace assertRegexpMatches with assertRegex
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
2016-03-31 13:28:39 +00:00
Jay Dobies
6dfc054cd0 Moved -t parameter for visibility
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
2016-03-29 14:44:57 -04:00
Jenkins
349a2c85b1 Merge "OSC plugin for orchestration template validate" 2016-03-29 01:37:11 +00:00
Pavlo Shchelokovskyy
ecd3504c4b Move OpenStack client to test-requirements
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
2016-03-28 09:00:25 +00:00
Jenkins
cff00ac9ba Merge "Use stack.get for resolving outputs for old API" 2016-03-28 04:26:23 +00:00
Jenkins
b262757a59 Merge "stack-delete command should not call do_stack_list." 2016-03-25 02:59:03 +00:00
Mark Vanderwiel
1d4c407fc5 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
2016-03-24 10:26:52 -05:00
Oleksii Chuprykov
fc4ff3875a Use stack.get for resolving outputs for old API
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
2016-03-22 20:57:14 +02:00
Steven Hardy
f13d36ae01 Fix regression handling relative paths in environment
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
2016-03-21 17:07:49 +00:00
PanFengyun
4bf7e55aa3 stack-delete command should not call do_stack_list.
the stack-delete operation is asynchronous, and should not return
anything.

Change-Id: I75287b612358c5e76e47a9e53200c23946f01d8f
Closes-Bug: #1556407
2016-03-17 12:59:30 +08:00