Resolve the following warning:
DeprecationWarning: distutils Version classes are deprecated. Use
packaging.version instead.
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I1db934e673b896834956d680f847687834e18520
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: I8f764e9ba46a4e2055be61eb0fe97d155ab1c70e
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
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 1 of a serie of 28 patches
Change-Id: Ia310a58ffdc688302b32d57a6bef6b1b8f5d9950
The new openstack-discuss mailing list is going to replace few
mailing lists, including openstack-dev.
Change-Id: I5d5f87614f692444728eb204f8d794e80179a4c8
Oslo.config deprecated parameter enforce_type and change its default
value to True in Ifa552de0a994e40388cbc9f7dbaa55700ca276b0. Remove
the usage of it to avoid DeprecationWarning: "Using the 'enforce_type'
argument is deprecated in version '4.0' and will be removed in version
'5.0': The argument enforce_type has changed its default value to True
and then will be removed completely."
Change-Id: I91b0f0a52b5ce8654702510eed76d5dea8cc8fe4
Related--Bug: #1517839
As of mitaka, the infra team won't have the resources available to
reasonably test py26, also the oslo team is dropping py26 support
from their libraries. sine we rely on oslo for a lot of our work,
and depend on infra for our CI, we should drop py26 support too.
Change-Id: I103ab61e29647e5830597343c6fbbbd3b9907afc
Closes-Bug: 1519510
Class Properties overwrites the __getitem__ method,
1. to raise KeyError if the key is an invalid
property, then the default value is return in supper.get() method
2. if the key is a valid property, the default value won't be
returned by using the format:
self.properties.get(key, default_value)
This patch changes to the format as following for case2:
self.properties.get(key) or default_value
Also, if the property is required or has default value in schema,
let's use self.properties[key] instead.
Change-Id: I2f546c69aa128c9aa6240ebd065df18a799b754d
Now if extension is not available, user gets
message 'Service endpoint not in service catalog'
which is incorrect. Patch corrects this behavior
and adds improved messages with more info.
Change-Id: I9b6c0d2921519590ef105be35e31db29cd1e3ecc
in heat/contrib/rackspace/rackspace/tests/test_auto_scale.py:270:
mock nova and glance client methods to satisfy contraints, contraints should be constraints
in heat/heat_integrationtests/functional/test_resource_group.py:51
triggering validation of nested resource custom contraints, contraints should be constraints
in heat/heat/common/exception.py:258:
"""Keep this for AWS compatiblility.""" compatiblility should be compatibility
in heat/heat/engine/resources/openstack/ceilometer/alarm.py:349:
1) so we don't create watch tasks unneccessarly , unneccessarly should be unnecessarily
in heat/heat/engine/resources/openstack/neutron/vpnservice.py:462:
The Internet Key Exchange policy identifyies the authentication and , identifyies should be identifies
in heat/heat/engine/resources/openstack/nova/server.py:1426:
if 'security_groups' present for the server and explict 'port' , explict should be explicit
in heat/heat/engine/service.py:182:
releasing the lock to avoid race condtitions. condtitions should be conditions
in heat/heat/engine/sync_point.py:134:
don't aggresively spin; induce some sleep, aggresively should be aggressively
in heat/heat/tests/openstack/heat/test_software_deployment.py:889:
Test bug 1332355, where details contains a translateable message, translateable should be translatable
in heat/heat/tests/test_environment.py:596:
make sure the parent env is uneffected, uneffected should be unaffected
in heat/heat/engine/resources/openstack/nova/server.py:472:
'ignorning it or by replacing the entire server.'), ignorning should be ignoring
in heat/contrib/rackspace/rackspace/resources/cloud_server.py:104:
'retained for compatability.'), compatability should be compatibility
in heat/heat/engine/stack.py:1258:
" ID %(trvsl_id)s, not trigerring rollback."), trigerring should be triggering.
Change-Id: Ic4ddb65dbfaf61751a330b853780689209f9f4b5
Closes-Bug: #1595376
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
In Python3, dict.keys() returns a view object rather than a list. This
behaves differently in that changes to the dict also modify the view, and
in that the view type interacts with various operators in different ways to
lists.
One universally correct transformation to preserve Python2 behaviour in
Python3 would be to replace all instances of d.keys() with
list(six.iterkeys(d)), and indeed we did. However, like many automatic
transformations the results are usually unsightly, invariably inefficient,
and frequently absurd. Not least because list(d.keys()) and indeed list(d)
are also equivalent.
This patch changes to using the simplest correct method of accessing the
data we want in each case.
This reverts or rewrites most of commit
4ace95ad47.
Change-Id: Iba3cf48246d8cbc958d8fb577cd700a218b0bebf
Custom Cloud Server images do not have the 'flavor_classes' key in
their metadata, so try to get it from the base image. If
'flavor_classes' is empty or does not exist, skip image/flavor
validation.
Closes-Bug: #1570087
Change-Id: I44fd02c689ba0c06ba571d04e9baf0eb0ce035ff
Eliminate from the unit tests the deprecated use of a ResourceDefinition as
if it were a snippet from a CloudFormation template, in preparation for
this being removed in future.
Change-Id: I0449d3bff19c1294a9d0a475a4a9b623c73e11db
Remove the last few instances of treating a ResourceDefinition as a snippet
of a CloudFormation template (rather than using the API) in various
resources.
Change-Id: I7266385121530b76d1955e466b3d51fae860a5ee
Now that we have an API for determining the difference between resource
definitions in Heat, use it instead of treating the tmpl_diff argument to
handle_update() like a diff of snippets from a CloudFormation template.
Change-Id: Ib54ff610065ad8d4eabc7d6a45213fde93e425c8
This makes sure that type checking is done by oslo.config
on the test override values.
Change-Id: Ia8c1cb55fe98e9d06b9b9ff13e5c2d25aa67bff3
Closes-bug: #1517839
This changes OS::Nova::Server resource to use
translation rules to resolve name_id properties.
As most of the tests in test_server.py and
test_rackspace_cloud_server.py are impacted by this
change, this also changes all the tests to use mock
library. Though the change is very big, it's mostly
mox to mock conversion for the tests.
This reduces the LOC drastically. Some of these test
modules have become very big to manage. We can split
them into smaller ones in the future.
Change-Id: Iaa630ab3b013dfb65e9131b1f265e846c8274037
Partial-Bug: #1514680
Blueprint: mox-to-mock-conversion
The image and flavor used to build a Rackspace server must
satisfy certain properties to successfully build the server.
This patch adds Rackspace Public Cloud specific validation
to enable such checking so that invalid combinations are
discovered before the start of stack creation.
Change-Id: I2f676b5c06190ddc1077c13bbe3482a23d1d01fd
Co-Authored-By: Anna Eilering <anna.eilering@rackspace.com>, Jason Dunsmore <jasondunsmore@gmail.com>
To avoid the InvalidTemplateReference exception when resolving
get_resource functions for resources that are in the sub-template but
not the parent template.
Change-Id: I985b58ff95efbc7926cec708d2b37d8ce95c3390
Ensure config_drive is enabled automatically if
the user data format is SOFTWARE_CONFIG. Also,
limit the choices for transport and format to
only those supported at Rackspace.
Change-Id: Ia8bb09d991843860a8f0cfb73453b789fde28afd
The oslo.utils.reflection.get_class_name() handles more variations
of where a class name may come from (on) python 2 and python 3.
Its usage allows getting more accurate class names so we'd better use it.
Change-Id: Iff0e109a558d0185f126781369bac216da930bca
Rackspace AutoScale Groups now support a "launch_stack"
launchConfiguration type. This adds support to the
Rackspace::AutoScale::Group resource.
Change-Id: I20d2d9d4f317d726ccbb21275984f096ba300767
This fixes a bug where the load balancer creation fails with this
error:
resource CREATE failed: BadRequest: resources.loadbalancer: Must
supply a unique access list item to update the current list. (HTTP
400)
Closes-Bug: 1541953
Change-Id: I5183b305a7bf2cef16e5e01e88fdb3f24aeb4be5
Without these defaults, the resource can get stuck in update until the
stack times out.
Change-Id: I58a5b70959e6107eefb4351d77315c0bceb9b717
Closes-Bug: #1539230
This is a resource for representing a single node of a Load Balancer.
It has the ability to drain the connections off of a node before
deleting it.
Change-Id: Idfdce6c078e51f43e368a642a9c116565f3352b4