summaryrefslogtreecommitdiff
path: root/heatclient/common/utils.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove sixTakashi Kajinami2022-05-091-12/+5
| | | | | | | This library no longer supports Python 2, thus usage of six can be removed. Change-Id: I8d0c1cfd6dff375b3b7756a5b36c95a2df3f04c6
* Python 3.9: base64.encodestring is removedThomas Goirand2020-10-161-1/+1
| | | | | | | We should use base64.encodebytes instead, which is avaiable since Python 3.2. Change-Id: Ic945aff08d00bf2e602964cb1e25ea045e645b17
* Update hacking for Python3ussuri-em2.1.0Andreas Jaeger2020-03-311-2/+2
| | | | | | | | | The repo is Python 3 now, so update hacking to version 3.0 which supports Python 3. Fix problems found. Change-Id: I82c745f5b1236844deec4538be84037a64eebeee
* Cleanup of .keys() from dict_object.keys() *in* operatorjacky062019-12-051-1/+1
| | | | Change-Id: I49bb58e5dc2618ee02424315e4e3bf1057a77068
* Replace six.iteritems() with .items()M V P Nitesh2017-03-311-1/+1
| | | | | | | | | | | | 1.As mentioned in [1], we should avoid using six.iteritems to achieve iterators. We can use dict.items instead, as it will return iterators in PY3 as well. And dict.items/keys will more readable. 2.In py2, the performance about list should be negligible, see the link [2]. [1] https://wiki.openstack.org/wiki/Python3 [2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html Change-Id: I3913e8876b34e112140788d7a405da6eedfb5f29
* Remove log translationsliyi2017-03-231-2/+1
| | | | | | | | | | | | Log messages are no longer being translated. This removes all use of the _LE, _LI, and _LW translation markers to simplify logging and to avoid confusion with new contributions. See: http://lists.openstack.org/pipermail/openstack-i18n/2016-November/002574.html http://lists.openstack.org/pipermail/openstack-dev/2017-March/113365.html Change-Id: I601eee9f1fca65d5fb53e6b75482b74283908a29
* Merge "Make method import_versioned_module work"Jenkins2017-01-101-8/+0
|\
| * Make method import_versioned_module workshizhihui2016-11-091-8/+0
| | | | | | | | | | | | | | | | | | | | Oslo.utils 3.17 provides similar function, just use it. For more information: [1] http://docs.openstack.org/developer/oslo.utils/history.html Closes-Bug: #1627313 Change-Id: Ie738e910cc72535fe97295d7e118eda2412ecd15
* | Merge "Add convenience function for events over websocket"Jenkins2016-12-271-2/+4
|\ \
| * | Add convenience function for events over websocketThomas Herve2016-12-191-2/+4
| |/ | | | | | | | | | | | | This adds an alternative method of poll_for_events using a websocket connection. Change-Id: I1c46af3ab98b6d108af976e4fab5282c8756a626
* | Move required modules from oslo-incubatorrabi2016-11-121-5/+88
|/ | | | | | | | | | | | Move the required module to heatclient/common. - heatclient/openstack/common/apiclient/base.py It also moves some required functions and exceptions from heatclient/openstack/common/cliutils.py and heatclient/openstack/common/exceptions.py. Change-Id: I68704c7fab9417492d8390ad05a9797f78d46907
* Graduate to oslo.i18n and cleanup incubator usageChuck Short2016-11-081-2/+2
| | | | | | | | | Graduate from Oslo Incubator to oslo.i18n library. Cleanup of unused Oslo Incubator utils. Added optional enable_lazy() usage. Change-Id: I5ec02477f3f52f4d7097669120581e82cced3748 Signed-off-by: Chuck Short <chuck.short@canonical.com>
* Show resource name path in event log formatterSteve Baker2016-09-061-2/+70
| | | | | | | | | | | | | | | | | | | The resource name path was introduced in the 'openstack stack failures' command and is a user-friendly way of referring to a deeply nested resource. This change modifies the event log formatter to build and display the resource name path for each event based only off data in previous events. For building the full resource path, and omitting ugly stack names from the resource path, the following heat change is needed Ib8feb7752bd5736785d142216312bb35629b3601. However the output is still improved slightly when running against an older heat which does not have this change. Change-Id: I86b687fc516da215a6baeef8b365a520d12a8ab1 Closes-Bug: #1619415
* Use poll_for_events for "openstack stack delete"Mark Vanderwiel2016-03-011-25/+0
| | | | | Change-Id: Ie918e095e7d67c94991f1a7e4b0ede9127134936 Blueprint: heat-support-python-openstackclient
* OpenstackClient plugin for stack deleteAmey Bhide2016-02-121-0/+25
| | | | | | | | This change implements the 'openstack stack delete' command. Blueprint: heat-support-python-openstackclient Change-Id: I95df1390a9daee7115ccda68b261e0a76530ade4
* Edit backslashes for lines continuationsOleg Khavroshin2016-01-281-4/+5
| | | | | | | | It is preferred to wrap long lines in parentheses and not a backslash for line continuation due to OpenStack Style Guidelines http://docs.openstack.org/developer/hacking/#general, paragraph 2 Change-Id: I83cd72a06bcee750876fb9e127959b16107e2f79
* Use six.iteritems() instead of iter(XXX.items())dixiaoli2015-11-221-1/+1
| | | | | | This patch changes the method iter(XXX.items()) to six.iteritems() Change-Id: I178cfae85e0c128633f30236da565be8b2c7acc1
* Refine event_log_formatter outputSteve Baker2015-11-161-11/+3
| | | | | | | | | | - Fix timestamp printing so that date is first, and time doesn't have truncated seconds - Remove event UUID from output since it is of limited usefulness and causes clutter Change-Id: I646be059546289b4131956ba050ec1f1f74ab3b9 Closes-Bug: #1516481
* OpenStackClient plugin for stack showSteve Baker2015-10-161-0/+4
| | | | | | | | | | | | | | | | | | | | | | | This change was derived from Id188cdc0e97b480875a7626443f68e69863f0647 which added stack support to python-openstackclient, but adapting it to be an openstackclient plugin which lives in the python-heatclient tree. This change only implements the "openstack stack show". Subsequent commands will remain in WIP changes at the end of this series until they are ready to merge. The stack show formatting has the following behaviour: - specifying key order for important values, but adding all other stack keys in default order (future proofing for new values) - exclude template_description, its a dupe of 'description' - complex values like parameters, outputs and links get a special formatter depending on the output format ('table' formats them as yaml, 'shell', 'value', 'html' formats them as json) Co-Authored-By: Ryan S. Brown <rybrown@redhat.com> Co-Authored-By: Rico Lin <rico.l@inwinstack.com> Change-Id: I3096b94146a94d184c29b8c7c9f6c032eed5281d
* Fix the bug when showing event in log formatzengyingzhe2015-09-301-2/+2
| | | | | | | | | | The event time displayed in log format is truncated, because the event log formater of heatclient resolves the event_time string incorrectly. Exchange the date and time fields splitted from event_time attribute, and don't truncate the last character of time_date[1]. Closes-Bug: #1498283 Change-Id: If94093e2b0531a78c26ba9baeceafc19b61df5f8
* Add CLI option for update dry-runRyan S. Brown2015-09-041-0/+28
| | | | | | | | | | | | | | | | When performing a stack-update using the --dry-run option will change the output behavior. Instead of printing a list of stacks, the --dry-run option will print the name, type, and action to be taken on resources in the updated stack. Docs change here https://review.openstack.org/132870/ Engine change here https://review.openstack.org/#/c/122473/ Implements: partial-blueprint update-dry-run Co-Authored-By: Jason Dunsmore <jasondunsmore@gmail.com> Change-Id: I3dd54084ce7bd5140b28e81b6eb2349123494de9
* Move usage methods *_request to get/post/etcPeter Razumovsky2015-06-091-0/+17
| | | | | | | | HTTPClient has methods get/post/put and others, which use json_request and raw_request, but other code uses requests method instead of them. Change-Id: I74ee34430afdae17f83ccdc877cc882f94651bce
* Adds --format=log option to event-listRakesh H S2015-05-221-0/+26
| | | | | | | | Provides functionality to print events as log. Closes-Bug: #1420504 Change-Id: I9bfb9676fbc3dd9d689e2db5bf3202378b344af7
* Add --nested-depth option to event-listSteven Hardy2015-04-161-0/+9
| | | | | | | | | | | | Adds logic to mimic the resource-list nested-depth option for events. Note that this is pretty inefficient, and in future we should add an API for nested_depth to the events API, but I want this to work for kilo heat, so this interim implementation will work for kilo, then I'll look at an alternative (faster) API-side implementation for Liberty, which will maintain the same CLI interfaces. Change-Id: I76c60ab5b79af9c477af07d5690b8ca6ca4da388
* Add option for heatclient to accept parameter value from fileRabi Mishra2015-03-301-8/+74
| | | | | | | | | | | A variant of -P (-Pf) which loads the parameter value from the specified files. $heat stack-create teststack -f sample.yaml \ -P "key_name=heat_key" -Pf "private_key=private_key.env" Change-Id: If73e702d035404356905db0f45bb15546b96ba3b Closes-Bug:#1334839
* Migrate to new oslo_xxx namespacetengqm2015-03-231-5/+5
| | | | | | | | This patch migrates the namespace of oslo packages from oslo.foobar to oslo_foobar. The oslo_incubator code need to be resynced, which will be submitted in another patch. Change-Id: Id77207750556b71f20797a0ee6f2cafd62ea30e1
* Make ; parsing optional in format_parametersSteve Baker2015-03-041-5/+6
| | | | | | | | | | Semicolon splitting is legacy behaviour from the old cfn client. New arguments (like deployment input values) can use format_parameters but won't want to support semicolon splitting. This change makes semicolon parsing optional. Change-Id: I1126fd8882d3ba68a03822e5f519656d78d2d535
* Fix different behavior in python3.4 json moduleThomas Herve2015-02-031-1/+2
| | | | | | | | THe 3.4 json changes the way json.dumps works when indent is specified, which breaks tests. Passing the separators argument explicitely forces the old behavior back. Change-Id: Ie27eb1491b984e65fedeb21864e2833ada2872fe
* Add transtlation markers for error messagesTetiana Lashchova2014-12-101-5/+9
| | | | | Change-Id: Ic44073880b7e65b6530a7314a5a2d65eb4aadb09 Partial-Bug: #1269930
* Convert importutils to oslo.utilsSteven Hardy2014-12-031-1/+1
| | | | | Change-Id: I58dfdc608bcddd0fce9df818033b2cb33eee3296 Partial-Bug: #1380629
* Move to oslo.serializationSteven Hardy2014-11-101-1/+2
| | | | | | | | Remove references to the now-removed oslo-incubator jsonutils, which has been deprecated and replaced with oslo.serialization Change-Id: I2483f5e1036471a9aae4e3185bf4b2f24afa99ea PartialBug: 1380629
* Fix shell tests for Python 3.4Tetyana Lashchova2014-10-281-0/+6
| | | | | | Partial-Bug: #1384511 Change-Id: I7485184a84ec850c4cd695118f18b55e298f5124
* Remove unused/mutable default argsAnderson Mesquita2014-08-221-1/+2
| | | | | | | Having mutable default args is a bad idea (http://docs.python-guide.org/en/latest/writing/gotchas/#mutable-default-arguments). Change-Id: Id941f259ff362f306582be5c2e4bdea133149491
* Add rel field to links displaySteven Hardy2014-07-241-1/+6
| | | | | | | | | Currently the "rel" keys from the links list are not displayed, so it's not that clear which link refers to what unless you're familiar with heat. So add a suffix which mentions the rel so e.g users can see "nested" there and tell the link refers to a nested stack. Change-Id: I5abe7f7b51c290bd9d8daaccb7f9a842af898f58
* Fix unicode display in parametersEthan Lynn2014-06-181-1/+1
| | | | | | | | | | When parameters contain unicode, stack-show will display unicode as '\u2665'. It's not easy to read by human. This change will change '\u2665' to readable unicode char '♥' when display to users. Change-Id: I00a74943138b292b71f848966ee64a658be64bc2 Partial-Bug: #1330370
* Using common methods from oslo cliutilsllg82122014-03-241-44/+5
| | | | | | | | | | | | | | Synchronize the cliutils from oslo to heatclient and use the common methods. used common methods: +arg +env +print_list partially implements blueprint common-client-library-2 Change-Id: If79d58794257325a47b9938a172a87097fc93e1b
* Remove None for dict.get()zhang-jinnan2014-02-191-1/+1
| | | | | | Because If no default value is specified it defaults to None already. Change-Id: I1ca522c7eebb2171d1a3efd35680ce42b89237b5
* Add filter option to stack-listAnderson Mesquita2014-02-051-1/+7
| | | | | | | | | | | | | | | | | Add ability to use filters on stack-list by passing a ``--filters`` options to the command line. This option can appear multiple times or be used once with several key=value filters separated by semicolons. If the same key appears more than once, both will be taken into account when sending the request to the API. e.g.: The option: ``--filters status=COMPLETE;status=FAILED`` Will issue the call: ``/stacks?status=COMPLETE&status=FAILED`` Closes-Bug: 1268816 Change-Id: I553d6b5e3ceebdb24dcd4e4c8e409a4375d72333
* Remove unused method 'string_to_bool' from utilsllg82122014-01-231-4/+0
| | | | | | | | | | | The method 'string_to_bool' in utils is not used. Furthermore, if we need this method in the future, we should use 'bool_from_string' from oslo cliutils to replace it. partially implements blueprint common-client-library-2 Change-Id: I21978d389a8721a40e1669351575297ce61a438e
* Misc typos in Heat clientanusha-rayani-72013-12-171-1/+1
| | | | | | Closes-Bug: #1256000 Change-Id: I1f607dd2c0499c1824442542a17e17bef8a0f020
* Use jsonutils from oslo incubatorChmouel Boudjnah2013-12-161-3/+3
| | | | | Partial-Bug: #1261224 Change-Id: I9a1e4e661e11a423586869ca504c41028934f8de
* Transform print statement to print functionKui Shi2013-10-231-4/+5
| | | | | | Partial implement: blueprint py33-support Change-Id: Ieed61447746bc5f598dcdfa89362aaa93f7c0dec
* Merge "Allow -P to be invoked multiple times"0.2.5Jenkins2013-09-271-10/+18
|\
| * Allow -P to be invoked multiple timesSteve Baker2013-09-251-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If --parameters is specified more than once it is assumed that each one contains only one parameter key=value. This means semicolons are ignored if there is more than one -P specified. This should be fully backwared compatible, a single -P will be assumed to be semicolon delimited. Change-Id: Ic202ff3e0596b786cd5b07c53509f97a95d41585 Closes-Bug: #1224825 Closes-Bug: #1229030
* | Replace OpenStack LLC with OpenStack FoundationZhiQiang Fan2013-09-201-1/+1
|/ | | | | Change-Id: I8f2697ca99192078d5db2adb4db98287520d9895 Fixes-Bug: #1214176
* Merge "Generate a template from a resource"Jenkins2013-08-131-1/+16
|\
| * Generate a template from a resourceAndrew Plunk2013-08-071-1/+16
| | | | | | | | | | | | | | | | | | Setup the command line options and calls for generating a template from an installed resource. blueprint resource-template Change-Id: If533bd90b1ec73bbe2603b55a0a7621879d355ec
* | Fix heat event list sorted order incorrectJUN JIE NAN2013-08-081-2/+5
|/ | | | | | | | | 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
* Make the parameter checking consistent.Angus Salkeld2013-07-161-1/+3
| | | | | | | | | 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
* Format resource required_by in resource-show.Steve Baker2013-07-041-0/+4
| | | | | | | This change has no effect if the resource details contains no requires key (such as for older API versions). Change-Id: I5bce5cf6a7c7cd3f531453cd126fb7b7b3e227ef