Commit Graph

261 Commits (master)

Author SHA1 Message Date
Takashi Kajinami 23e647539c Remove six
This library no longer supports Python 2, thus usage of six can be
removed.

Change-Id: I8d0c1cfd6dff375b3b7756a5b36c95a2df3f04c6
1 year ago
Takashi Kajinami 796a8f5a96 Replace deprecated import of ABCs from collections
ABCs in collections should be imported from collections.abc and direct
import from collections is deprecated since Python 3.3.

Closes-Bug: #1936667
Change-Id: Ie312cb884537ec541bf2111fe8a647e939b6519e
1 year ago
Takashi Kajinami b4383147fe Replace oslo_utils.fnmatch with fnmatch
The oslo_utils.fnmatch module was added to solve an issue in py2.7 but
it is no longer required because py2.7 is no longer supported.
The module was deprecated since oslo.utils 4.9.1[1] and the stdlib's
fnmatch module should be used instead.

[1] 4c893c92f551c9dd2a7cfbe7ae8171ad8139df0b

Change-Id: I95535adeb45363500b3ed9729bb61cb4308d23b9
2 years ago
Thomas Goirand 2b6f6ac284 Python 3.9: base64.encodestring is removed
We should use base64.encodebytes instead, which is avaiable since
Python 3.2.

Change-Id: Ic945aff08d00bf2e602964cb1e25ea045e645b17
3 years ago
Andreas Jaeger 9dede4eb2b Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Change-Id: I82c745f5b1236844deec4538be84037a64eebeee
3 years ago
Zuul 6b071d397e Merge "Add files-container option for stack create and update" 3 years ago
jacky06 fcc7befd0f Cleanup of .keys() from dict_object.keys() *in* operator
Change-Id: I49bb58e5dc2618ee02424315e4e3bf1057a77068
4 years ago
zhufl 036ae75689 Fix missing print format
This is to:
1. Add missing print format for "%(hook_type)".
2. Add ws between words in log message "notavailable".

Change-Id: Iaee8697c95f66bff0536db9a266158a3cbc89412
4 years ago
Rabi Mishra bd33e310e0 Set Content-Type header explictly for SessionClient
SessionClient is subclassed from keystoneauth LegacyJsonAdapter.
LegacyJsonAdapter does not set the Content-Type explicitly
and results in decodeing issues in some cases.

Change-Id: Idf23022b394607c332490331fc4b216de6ff1313
Story: 2005237
Task: 30027
4 years ago
rabi ae21e6b70d Set X-Region-Name in header when using SessionClient
We don't seem to set the header for region name when using session
client. It's used to look for service endpoints in the catalog.

Change-Id: I10cfdfb88b3f09e4ceb69b1020e82c4eba733804
Story: #2003806
Task: 26550
5 years ago
Mehdi Abaakouk 6ef3e8761e Don't change pyyaml behavior
When an application load heatclient, the default pyyaml behavior change.

This ensures only heatclient use it's custom pyyaml stuffs.

This currently breaks the telemetry gate if the tempest heat plugin is
loaded with the telemetry.

Change-Id: I5d7d1a1999e762f2285a0effc081252570f24de8
5 years ago
rabi bd2bfaa514 Add files-container option for stack create and update
If files-container option is specified:

- All template/env files would be fetched by the heat engine
  relative to the files_container and no local files other
  than the root template would be sent to server.
- Relative path of environment files would be sent in the
  environment_files list.

Also adds the option to template validate.

Change-Id: I1a703ab8798a003365be650886bb78be5af472b7
Story: #1755453
Task: 19319
5 years ago
liyi 6a27997abb Fix log_http_request function in http module
Change-Id: I043f90541c8d2d604f3edb4e7ea082ec8adb4b25
Closes-Bug:  #1746669
5 years ago
PriyaDuggirala f73c2a4177 Modify error message encountered during stack update
Parameters of an existing stack can be updated with
openstack stack update <stack> --existing --parameter <parameter>=<newvalue>
Example : openstack stack update stack1 --parameter p1=v1
If the --existing option is skipped, it leads to the below error
Need to specify exactly one of --template-file, --template-url or --template-object
This error is misleading as the user might think that stack update
cannot be performed without specifying a new template.

Modify the error message with --existing option.

Change-Id: Idce88bde848378e00b1c873245600ba205939668
Closes-Bug: #1723864
6 years ago
Thomas Herve 2a8ce0d065 Don't override sections in deep_update
When you comment all the elements in a YAML mapping, you end up with
None instead of an empty mapping, which can have bad side effect when
handling multiple environemnents. Let's handle that by ignoring the
latest None value.

Change-Id: I77ffabeb8d4cd2886ef4f41351e42ebe487b5d4b
6 years ago
Jenkins 565c05cce1 Merge "Decode content before checking" 6 years ago
rabi 485a679f3e Decode content before checking
Decode before checking for py3 compatibility.

Change-Id: Ic62ebc385146ab1406dd64384044d92be8171052
Related-Bug: #1695144
6 years ago
M V P Nitesh 61aa092ce5 Replace six.iteritems() with .items()
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
6 years ago
Thomas Herve 954e475a6a Build event stack_name from links
When retrieving events from nested stacks, we used to do a query per
stack and thus get the stack that way. We changed it to do only one API
call, but didn't fix the way the stack name was set. We need to use the
event links to retrieve the stack name, instead of the root stack.

Closes-Bug: #1676896
Change-Id: I09ab1cc2c6aaab02036b124b1dfa561dd6132083
6 years ago
liyi fb5e390891 Remove log translations
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
6 years ago
rabi b1c819f7d9 Use endpoint_type with session client
if endpoint_type is provided, map it to interface for
SessionClient as this endpoint_type is ignored.

Change-Id: If5bd96578e5bc4389b9eee6e53c598f6ffaf0d8d
Closes-Buf: #1665858
6 years ago
Jenkins 79b7975929 Merge "Distinguish between stack and resource events when polling" 6 years ago
Jenkins d29567796b Merge "Make method import_versioned_module work" 6 years ago
Zane Bitter 3e2bb47717 Distinguish between stack and resource events when polling
Don't accidentally treat a resource event like a stack event.

Change-Id: I0e4d97f9954adfac3124f6ed684b608f4da668b4
Closes-Bug: #1655142
6 years ago
Rob Cresswell de271ae757 Remove LOG Warning from __eq__
This causes a huge amount of spam on anything that does an equality
check, like tests. We should just remove it.

Change-Id: Ibb1a2132ab784ae357d965bd0997f419be568651
Closes-Bug: 1653975
6 years ago
Jenkins 87b03ceac6 Merge "Add convenience function for events over websocket" 7 years ago
Thomas Herve 6f94cfd791 Add convenience function for events over websocket
This adds an alternative method of poll_for_events using a websocket
connection.

Change-Id: I1c46af3ab98b6d108af976e4fab5282c8756a626
7 years ago
rabi ebb92f1acc Use default service_type with session
At present when using session with heatclient, you've to
specify the service_type. Use the only service_type
'orchestration', if not specified.

Change-Id: I994698784e5b30471f6d863034fa21aa8963fd9f
Partial-Bug: #1646539
7 years ago
Jenkins 2f4feffd73 Merge "Don't resolve outputs when polling events" 7 years ago
Thomas Herve cf2ecd453a Don't resolve outputs when polling events
In poll_for_events, we retrieve the stack to check its status. As it
stands we resolve the outputs as well, which is costly and useless in
this scenario. We can simpley get the stack to retrieve its status
without outputs.

Change-Id: Idc2327f6be15a679d502b0cd3e9d8980fdf1e22a
Related-Bug: #1638908
7 years ago
Jenkins 98f447ec0a Merge "Move required modules from oslo-incubator" 7 years ago
rabi 725dbf764f Use endpoint as endpoint_override
Number of projects like rally pass endpoint rather than
endpoint_override when using session with heatclient.

Use endpoint as endpoint_override when not specified.

Make it backward compatible.

Change-Id: Iff977424a15ac2ce3ffdf8d7c98d5e72d25c1e91
Closes-Bug: #1643507
7 years ago
rabi b25baa9108 Move required modules from oslo-incubator
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
7 years ago
shizhihui 8885ce7818 Make method import_versioned_module work
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
7 years ago
Chuck Short 29d6c613f6 Graduate to oslo.i18n and cleanup incubator usage
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>
7 years ago
Lars Kellogg-Stedman 0d218c92be handle empty sections in environment files
If an environment file has an *empty* section, as in:

    parameter_defaults:

This would ultimately fail in deep_update (in
heatclient/common/template_utils.py), which would get called with old
== None.  This patch handles this situation by explicitly setting old
= {} if deep_update is called with old == None.

Change-Id: Ia7bee87cdb99e29c63c9dc163f8490fef3f24f24
Closes-bug: 1631408
7 years ago
tamilhce f2147f79aa Don't use endpoint_override with session
We should not use endpoint_override by default and rather
use service_type with session. This also refactors some of
the associated code.

However, if one wants to override the endpoint they can pass
endpoint_override to the client constructor along with session.

Change-Id: I7c27d8ff827de3b4bb3e70457c0b6a3f47b6d7bb
Co-Authored-By: Rabi Mishra <ramishra@redhat.com>
Closes-Bug: #1621505
7 years ago
Jenkins 19ce71ba5d Merge "Show resource name path in event log formatter" 7 years ago
Steve Baker b28d8c6101 Show resource name path in event log formatter
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
7 years ago
Cao Xuan Hoang 80eecf92c9 Clean imports in code
This patch set modifies lines which are importing objects
instead of modules. As per openstack import guide lines, user should
import modules in a file not objects.

http://docs.openstack.org/developer/hacking/#imports

Change-Id: I9b7c8c7e37ee9861a63489f5b8fd611f2d31946e
7 years ago
rabi da0da4c1af Add parameter_merge_startegies section
This adds parameter_merge_strategies section to environment.
This also adds the missing section parameter_encrypted_names.
We use a server side module and a client side module that have
deviated over a period of time. This patch syncs them. We probably
should move these to a library and use use them for both server and
client in the future.

Change-Id: I9b20a7cedd416b6d8b788a30f66e472b85babf4a
Blueprint: environment-merging
7 years ago
Steve Baker 573b6657f0 Add a nested_depth argument to poll_for_events
This will allow library calls to have more control over the depth of
events which are logged.

Change-Id: Iecb8c89745f916c50936e013a62176d586cfcc63
Closes-Bug: #1616682
7 years ago
shizhihui 5dbbc102eb Standardize import format
According to the rule in http://docs.openstack.org/developer/hacking/#imports
I modify some irregular import format in heatclinet.

Change-Id: I0200ddad88ee833d7de9d6df2c1519e4f4560db7
7 years ago
Jenkins 641a8b48fe Merge "Enhance error message" 7 years ago
Jenkins 914921d26a Merge "Implement client side of event list --nested-depth" 7 years ago
Tang Chen bfde2f8e09 Use osc_lib instead of cliff
Base classes of commands are defined in cliff,
but have been encapsulated again in osc-lib for
all plugin clients. So use osc-lib instead of
cliff.

Change-Id: I0e430457af3033ebf56e47f85c0cfd71d2227cf7
7 years ago
zzxwill e4bd904826 Enhance error message
Need to add a space between '%(resource)s' and
'not'

Change-Id: I554653609deb72acf0e0926de0eeb81426110c03
7 years ago
Jenkins b89f2c59e2 Merge "Implement "openstack stack failures list"" 7 years ago
Steve Baker 31278ff5f7 Implement client side of event list --nested-depth
This change does the following:
- cleans up the usage of get_events so that marker and limit are only
  specified in their dedicated arguments, not also in event_args
  (also, specifying only in event_args still works)
- first attempts server-side nested_depth support
- falls back to the old recursive approach if the response data lacks a
  link with the ref root_stack

Since there is a fallback for old heat APIs, the client change can
land before or after the heat change
I27e1ffb770e00a7f929c081b2a505e2007f5d584

Change-Id: I43d12ec61ec359222184f07c170de3c97481f1ba
Closes-Bug: #1588561
7 years ago
Jenkins 1e86edb08c Merge "Serialize files when using SessionClient" 7 years ago