Six is in use to help us to keep support for python 2.7.
Since the ussuri cycle we decide to remove the python 2.7
support so we can go ahead and also remove six usage from
the python code.
Review process and help
-----------------------
Removing six introduce a lot of changes and an huge amount of modified files
To simplify reviews we decided to split changes into several patches to avoid
painful reviews and avoid mistakes.
To review this patch you can use the six documentation [1] to obtain help and
understand choices.
Additional informations
-----------------------
Changes related to 'six.b(data)' [2]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
six.b [2] encode the given datas in latin-1 in python3 so I did the same
things in this patch.
Latin-1 is equal to iso-8859-1 [3].
This encoding is the default encoding [4] of certain descriptive HTTP
headers.
I suggest to keep latin-1 for the moment and to move to another encoding
in a follow-up patch if needed to move to most powerful encoding (utf8).
HTML4 support utf8 charset and utf8 is the default charset for HTML5 [5].
Note that this commit message is autogenerated and not necesserly contains
changes related to 'six.b'
[1] https://six.readthedocs.io/
[2] https://six.readthedocs.io/#six.b
[3] https://docs.python.org/3/library/codecs.html#standard-encodings
[4] https://www.w3schools.com/charsets/ref_html_8859.asp
[5] https://www.w3schools.com/html/html_charset.asp
Patch 5 of a serie of 28 patches
Change-Id: Idb037ded55698790fc1658896f1e2dcdce89f3f9
This provides an option to specify a swift container for stack
actions and all child templates and env files will be fetched
from the container, if available. However, files coming in the
'files' map from the client will have precedence, if the same
is also present in swift.
Change-Id: Ifa21fbcb41fcb77827997cce2d5e9266ba849b17
Story: #1755453
Task: 17353
swiftclient doesn't use oslo_log and logs ERROR with TRACE for
response exceptions like 404. This isn't desirable for heat which
relies on 404s to know a delete is complete.
This change sets the swiftclient logging level to CRITICAL in the
client plugin.
Change-Id: Ie11a6d19068169424ee883ce428aad306d647f0d
Partial-Bug: #1606404
Now that we store the keystone session in the context,
we can use them to create the client plugins.
Change-Id: I9c870691ad5f6b1099dba51b5ef4c54360b65122
Heat makes a lot of variations to the basic oslo.context which are going
to make it very hard to reuse with features added to the base
oslo.context.
There are a number of changes here that will make the heat context
options more like those from oslo.context.
*) context.user and context.tenant are IDs, not names. This will be
important for policy credentials.
*) kwargs should be passed through to base context so it can be extended
in the base class.
Change-Id: Ib0d60c6af196ba5c00459110b7a6190cff916d6f
Create CLIENT_NAME for every client, which can be used to replace seperated
string for service client name.
Change-Id: Id8425e8cca3ad9cea5f7364fdf057260e1d8f27c
* importutils.import_object results in a cfg.NoSuchOptError than
a RuntimeError, handle the cfg.NoSuchOptError too.
* text.MIMEText content cannot be None in python3, use an empty
string instead if the content is None.
* convert to bytes before using hashlib.sha256
* add a message keyword argument along with the cinder exception
because self.__class__.message doesn't exist for exceptions in py34
* assert whether the string is against exception.args instead of the
exception object itself.
* assert against a dictionary rather than a flattened string
for consistent checking
* convert json strings to json before asserting/comparing
Change-Id: I5bbbc75373ce8009f0791cd2c7df1ba4c2d473b2
As part of the review https://review.openstack.org/#/c/192529
service_types was added to client_plugins to support the
conditional resource plugin availability.
I found its good to organize this code better by adding
str_key for each key defined in the service_types
so that we no longer have to depend on the index when
multiple service_types are available for a client plugin.
implements blueprint: keystone-based-resource-availability
Change-Id: I352525cce991f664abb28df9569d498cd44baf18
service_types is added to client_plugins to support the
conditional resource plugin availability.
implements blueprint: keystone-based-resource-availability
Change-Id: I28d606416acd1d47a09f3c62b5236b5f53583f60
This change allows swift TempURLs to be used to signal heat from
server deployments.
When signal_transport: TEMP_URL_SIGNAL is specified, the following will happen:
* On creation a swift object will be created with an associated TempURL for PUTs
* The PUT URL is used for the deploy_signal_id input value, along with the new
deploy_signal_verb input being set to PUT
* In the deployment resource check_complete, the swift object is polled for
new signal contents, and signal() is called when the swift object contents change
By specifying deployment signal_transport: TEMP_URL_SIGNAL and
server software_config_transport: POLL_TEMP_URL it should now be possible to use
config/deployment resources with only a keystone v2 API (or with a standalone heat)
Implements-Blueprint: software-config-swift-signal
Change-Id: I1dfba248dcfc90c3d872ba35f0aa935cca5c5606
SwiftClientPlugin.get_temp_url has the potential to race with
itself when storing a new tempurl key to the swift account,
leading to tempurls being built with a key that has been
overridden.
This change always fetches the key from swift before creating a
temp URL.
Change-Id: Id5897fdd834cc5d3b74fda8d2317d084a5564c51
Closes-Bug: #1413366
Rackspace Cloud Files uses a UUID for the tenant ID, so move the code that
validates that part of the TempURL to the client.
Change-Id: I996fdc4b4b66e110066353d3b22ea3dab0535a5d
This change adds common methods which allow resources
to handle client exceptions without needing to directly
import the exception types.
The most common client resource exception handling is:
* Detecting if an exception is a 404
* Raising any exception which is not a 404
* Detecting if an exception is a 413 (over limit)
* Detecting if an exception was raised by a particular client
library
Subsequent changes will move to using these methods.
Change-Id: Ib2bd55c31e66b562cfa8388beb450be6c06cc4fb
This moves the client creation code out of Clients._swift() into
its own client plugin.
Importing swiftclient exceptions from the plugin is an interim
solution until the client plugin mechanism provides a way of
handling client-specific extensions.
Swift is a core project, and python-swiftclient is a dependency,
so the import is now mandatory.
Change-Id: Ib2cff83096639855eaa1e05febbb4b490edd6250