100 Commits

Author SHA1 Message Date
ZhiQiang Fan
5cb3fc07d5 Support --version for heatclient
Closes-Bug: #1220524
Change-Id: Id78f7c7c78d31c0126b43f7a846f02f2542b0b7c
2013-09-04 14:29:56 +08:00
Jenkins
e2cbb45036 Merge "Be backward compatible after a renaming in API" 2013-09-04 03:35:34 +00:00
Jenkins
a7ffcd76d0 Merge "Fix and enable Hacking H501 warning" 2013-09-04 03:12:33 +00:00
Alex Gaynor
9d19772089 Added support for running the tests under PyPy with tox
This is a precursor to having them run under check and gate.

This also fixes a single test which fails on PyPy, the test failes at
because it assumes a ``dict`` has a particular order for its keys when
it is printed out, on PyPy dicts have a different order sometimes, the
exact ordering is not a guarnteed property of Python.

Change-Id: Ie86726a0221e5e9aa68f7303d8ca8c7acd878f65
2013-09-03 17:32:09 -07:00
Dirk Mueller
d48d3587bd Fix and enable Hacking H501 warning
Enable Gating on H501. Fix the only two cases
that trigger.

Change-Id: Ib309b989df6556d7436e718e1497ce4dcacc83d6
2013-09-02 21:39:21 +02:00
Swann Croiset
b95657fd15 Be backward compatible after a renaming in API
The need was introduced with the renaming of field logical_resource_id
to resource_name, so let heatclient display the good one for the two
Heat versions.

Fixes bug #1216903

Change-Id: I3e86f482a1b814a27b15be3c102727c44153221f
2013-08-29 16:37:45 +02:00
Jenkins
a5d71080ef Merge "Add X-Region-Name parameter in HTTP request" 2013-08-27 15:35:58 +00:00
Swann Croiset
6f99131805 Rename event logical_resource_id to resource_name
Required by Heat change (https://review.openstack.org/#/c/43391/)

fixe bug #1216903

Change-Id: I77201348df401d5bafc7109bb4d032dd071468d8
2013-08-26 15:19:37 +02:00
Jenkins
0b2122eae1 Merge "Do not obscure Unauthorized error messages" 2013-08-25 23:21:18 +00:00
Nachi Ueno
1426237c38 Add X-Region-Name parameter in HTTP request
In order to specify region_name, we let client send
the OS_REGION_NAME in header file

Fixes bug 1213291

Change-Id: Ie44f700ca7e412c2504b6b8faac3fd65d4fd744b
2013-08-22 15:18:54 -07:00
Nachi Ueno
e540b68416 Apply OS_REGION_NAME for endpoint selection
Even if we got OS_REGION_NAME on CLI, the value is not used.
In this commit, we apply OS_REGION_NAME for endpoint
selection.

Fixes bug 1215588

Change-Id: Ib2e2f655282b2730a9a3b7337e56993253972ce1
2013-08-22 12:24:15 -07:00
Steve Baker
e81f590ea9 Do not obscure Unauthorized error messages
All Unauthorized exceptions are currently trapped and
the following message is printed:
    Invalid OpenStack Identity credentials.

This is unhelpful now that heat-api is providing structured
errors with (sometimes) helpful context for authorization failures.

This change removes this error trapping and prints the intended
error message.

Change-Id: Ibd943deb1f365e5f212225be1e675beb14accf97
2013-08-21 10:26:21 +12:00
Jenkins
c0457ff0d4 Merge "Generate a template from a resource" 2013-08-13 20:57:02 +00:00
JUN JIE NAN
2d1592e934 Fix heat event list sorted order incorrect
The order is correct already if python heat client does not recorder
it. Add option to make print_list not to reorder possible, and call it
in do_event_list.

Change-Id: I3f0990aff27df39371c583d5aae3edd106542ad1
Fixes: bug #1209506
2013-08-08 16:40:17 +08:00
Andrew Plunk
68999ba81f Generate a template from a resource
Setup the command line options and calls for generating
a template from an installed resource.

blueprint resource-template

Change-Id: If533bd90b1ec73bbe2603b55a0a7621879d355ec
2013-08-07 09:47:40 -05:00
Steve Baker
2c05c73a6b Remove unused Stack data method
Change-Id: Ia3fce29a58957b84f2eba33ac1b2ecfb04543939
2013-08-07 12:57:03 +12:00
Steve Baker
79dea076db Do not paginate stack list unless page_size is set
Pagination on the server has not yet been implemented, however
the client assumes it is, causing infinite recursion when paginate
is called.

With this change, no pagination is attempted unless page_size is
specified. However the 'limit' parameter is still honored, so it
is still possible to cap the total number of results returned.

heatclient users should not set page_size until pagination has been
implemented on the server. The stack list in Horizon currently
does not attempt to paginate, so is not affected.

Fixes: bug #1207839
Change-Id: I4087d3a8af48206d6ebe3edc441469464e4a401a
2013-08-07 12:56:58 +12:00
Steve Baker
ea0e957978 Custom Stack get method to avoid lookup redirects
Change-Id: I15dd4e9168cba6fd05371fed097d52cbf33cb15d
2013-08-07 10:40:13 +12:00
Steve Baker
6f7239f67b Fix Stack instance delete method
The current instance delete method assumes that a Stack
instance can be passed to the manager delete method, however
the manager delete method only accepts a stack identifier.

Change-Id: I87c30be1ea43695b7e13953531ea282fd8d386f8
2013-08-07 10:37:58 +12:00
Monty Taylor
9104cb00a1 Sync with global requirements
Change-Id: Iad82b688da07f3aa83a9850b5ea9fe2beb51019e
2013-08-05 18:43:13 -03:00
Steve Baker
529d429d49 Implement Stack status and action properties
This splits the stack_status back to an action and status,
as it is represented internally in heat-engine.

It assumes there will not be an action which contains an _.

This change is needed for code (such as tempest) which assumes a
convention of all openstack client resources having a status property.

Change-Id: If00db5508bf8469b1106cac20b8fc10f7e1a854d
2013-08-02 14:45:25 +12:00
Jenkins
cae2c0fd7b Merge "Parse error object (in json format) returned by heat-api" 2013-07-30 05:09:12 +00:00
Jianing YANG
2b83260feb Parse error object (in json format) returned by heat-api
With this fix, heatclient will display a clear error message when
encounter an server-side error. Additionally, the corresponding
traceback will be displayed when "--verbose" is set.

Change-Id: I99b828465f61478a3c63fcf549d044a62523be1f
2013-07-26 20:52:04 +08:00
Jenkins
e5d68a48af Merge "Set credentials headers if there is no auth token." 2013-07-22 17:23:49 +00:00
Jenkins
34993c6b69 Merge "Validate heat url is supplied for --os-no-client-auth." 2013-07-22 17:22:48 +00:00
Steve Baker
78c98ee91b Set credentials headers if there is no auth token.
Credentials will be set instead of a token for all invocations where
--os-no-client-auth is specified.

Change-Id: I35a81a9518833ce9758228266deb36c8073f9fb8
2013-07-19 14:09:34 +12:00
Steve Baker
0254ad50a2 Validate heat url is supplied for --os-no-client-auth.
Currently an obscure error is returned if --heat-url is not
specified.

Change-Id: Ia9fbb694f38e583a0cf1898f576a894d1007f697
2013-07-19 13:15:49 +12:00
JUN JIE NAN
e14758686f Display yaml format for stack deployed via hot template
Determine hot template and display yaml format for it, display json
format for others.

Change-Id: Ie8d72c222a992ee0048897d040e8bc88fcf51760
Fixes: bug #1201482
2013-07-16 14:01:14 +08:00
Jenkins
b417688d21 Merge "Only set X-Auth-User, X-Auth-Key on stack create/update." 2013-07-16 03:22:00 +00:00
Angus Salkeld
710f7512bb Make the parameter checking consistent.
Make format_parameters() raise CommandError with
the same message. Rather than raise MalformedRequestBody
and then catch that and raise CommandError. This just
simplifies things.

Change-Id: Ic05af32dd916e953e6b162daccc4525cb4734a46
2013-07-16 12:24:35 +10:00
Angus Salkeld
2198a76839 Fix "heat validate" (add needed environment option)
since it calls template-validate it needs that same options.

Change-Id: Ic024707240af59b862146d4f478e495a93b5cd7a
2013-07-08 14:58:14 +10:00
Steve Baker
42592898c3 Only set X-Auth-User, X-Auth-Key on stack create/update.
All heat operations can be performed with only a token.

User credentials are required for stack create/update as they are
stored for later stack operations.

This change prevents credentials unnecessarily being sent over the wire.

Change-Id: I5ad18067c5db8ada9994d131e98f27af70a7ca06
2013-07-05 10:10:20 +12:00
Jenkins
9cba3dab02 Merge "Format resource required_by in resource-show." 2013-07-03 22:45:52 +00:00
Jenkins
8dd6074d88 Merge "Unit tests for pretty table special formatters." 2013-07-03 22:35:18 +00:00
Steve Baker
5320a3a49a Format resource required_by in resource-show.
This change has no effect if the resource details contains
no requires key (such as for older API versions).

Change-Id: I5bce5cf6a7c7cd3f531453cd126fb7b7b3e227ef
2013-07-04 09:18:35 +12:00
Steve Baker
f535cf99d0 Unit tests for pretty table special formatters.
Change-Id: If07b4a5fc0c4ae2eecf486433134864270757945
2013-07-04 09:18:32 +12:00
Steven Hardy
0a23b8bd55 Add support for suspend/resume actions
Adds support for action-suspend and action-resume

blueprint stack-suspend-resume

Change-Id: If82e6b19756d3eae8a379141ae1f25565895e262
2013-07-03 17:04:39 +01:00
Angus Salkeld
7774ac3217 Upload provider templates referenced in the environment.
blueprint provider-upload
Change-Id: I3cbfe90dd8b4d152837666fa7f50b4b4a33bee27
2013-06-29 20:54:38 +10:00
Angus Salkeld
a77fd1348d Fix all but H302 hacking rules.
Change-Id: Iac329617428b851df42579d5bd0b299d2f6e2c0a
2013-06-27 13:22:07 +10:00
Angus Salkeld
2fcd4570f3 Fix all the pep8 E* and F* errors.
Change-Id: I34bab949e4795073544c64c9796237c60ace4d65
2013-06-27 13:13:14 +10:00
Dirk Mueller
61ce60358e Fix various smaller pep8 issues
Change-Id: Icc015418e0e231311ac0a0cc507fa3f8842d8811
2013-06-20 20:43:19 +02:00
Bryan D. Payne
f75b0d9422 Stop passing path to VerifiedHTTPSConnection
This class doesn't expect this argument.  Passing the argument causes the
client to break on all HTTPS connections.

Change-Id: I56f02b3a8943ff9a8b9e7855796fd527683514f3
Fixes: bug #1190111
2013-06-13 12:23:10 -07:00
Jenkins
5f3e7ef850 Merge "Use Python 3.x compatible except: construct" 2013-06-11 00:13:16 +00:00
Dirk Mueller
798d62e9d3 Use Python 3.x compatible except: construct
Per (propsed) Hacking H203 check, use the
non-deprecated except x as y: construct which
works with any Python version >= 2.6

Change-Id: Ibe58125719ba7fccf68974555a4b93f9dcdad6ae
2013-06-07 15:56:53 +02:00
Jenkins
b1eab178b1 Merge "Add support for environment files" 2013-06-07 00:16:21 +00:00
Jenkins
6aeb0993d9 Merge "Migrate to testr from nose." 2013-06-03 22:43:19 +00:00
Sulochan Acharya
9b1ce21081 Fixes text split for parameters
Make text split only on the first "=" element, this will
allow for values to have multiple "=" in the string.
Also, ensure that key = value pair is honored in parameters,
exit otherwise with error message. Tests included.
Fixes bug #1183842

Change-Id: Ic8897405c61dee49f5927b53f055b0d0686eea7d
2013-05-31 13:40:44 -05:00
Angus Salkeld
44740d8ccb Add support for environment files
env.yaml:
"
parameters:
 KeyName: heat_key
"
heat stack-create foo -e env.yaml -P "<more params here>" -f bla.yaml

blueprint environments
Change-Id: If40d4b6396cc69452bb1e13654ca8bb3d61e24fb
2013-05-31 20:56:30 +10:00
Angus Salkeld
c4174d39ae Migrate to testr from nose.
Change-Id: Ibe0c2eeee9aeb4cb1832456cdc0d080a5a9af175
2013-05-31 20:13:37 +10:00
Monty Taylor
2e6e49f7fa Migrate test base classes to testtools.
This is in prep for testr changes, but also cleans up
several things in the tests where state could leak.

Change-Id: I7f53dcee2f1fcffb622dd475ea8cf433ce43dbb2
2013-05-25 09:27:06 +02:00