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
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
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
This patch calls client.remove_container after a container has stopped
running in response to client.kill.
In the event that a container is created with an explict name, as in:
docker_dbserver:
type: "DockerInc::Docker::Container"
properties:
image: mysql
name: dbserver
Failure to remove the container on delete will prevent the stack from being
re-deployed.
Change-Id: Ic864d1a808b303fcb58815b87e55a0e7d1639bbb
closes-bug: #1364019
Fix failing convergence gate functional tests
- store resource uuid, action, status in cache data. Most of the code
requires the resource to have proper status and uuid to work.
- initialize rsrc._data to None so that the resource data is fetched from
db first time.
Change-Id: I7309c7da8fe1ce3e1c7e3d3027dea2e400111015
Co-Authored-By: Anant Patil <anant.patil@hp.com>
Partial-Bug: #1492116
Closes-Bug: #1495094
It is convenient to have all exceptions in exception module.
Also it is reduces namespace cluttering of resource module and decreases
the number of dependencies in other modules (we do not need to import resource
in some cases for now).
ResourceInError exception is moved in this patch.
Change-Id: I122c032468efeb97d165af4ae372bc35b60a11a2
This change adds support_status to all the resources that are in the
contrib area of the repository that don't have it already. These resources are
given the UNSUPPORTED status, to indicate that the Heat team is not responsible
for maintaining them.
Change-Id: I8835bf3f99774c40da1e8d34a474071a71686cd1
This will allow Resources to hold weak references to Stacks (so as to avoid
circular references) without causing the Stack object to be prematurely
deleted.
Change-Id: Ia76da7bc51042fb3598ef2a660d6fbf78137a37b
Related-Bug: #1454873
The pbr 0.11.0 release has shown that having multiple trees in a repo
each with their on version that is different to the git history is
really not going to work.
This change means that the version will be derived from git history,
which will still be useful for operators managing what version of a
plugin they have installed.
Running sudo python setup.py install (as documented) is known to work
with the latest pbr.
Change-Id: I716a5374bb283d11e26459b5866a0437ab6fe0dd
Closes-Bug: #1450733
Docker 1.2.0 and docker-py 0.6.0 support the device parameter when
starting containers(docker run --device[]).
Using --device you can add a host device to the container without the
--privileged flag.(e.g. --device=/dev/sdc:/dev/xvdc:rwm)
Note:":" is used to split the full device path.
Reference: (parse_devices function)
https://github.com/docker/docker-py/blob/master/docker/utils/utils.py#L259
Change-Id: I7735a8b769062f442cc8f1810dbdecdc6324509e
Closes-bug: #1434427
Docker API 1.8 and docker-py 0.3.0 support the cpu-shares parameter when
creating containers(docker run --cpu-shares=0).
By default, all containers run at the same priority and get the same
proportion of CPU cycles, but you can tell the kernel to give more shares of
CPU time to one or more containers when you start them via Docker.
Change-Id: Ic20cc56070c120ab46379aa42d5da6ac9425cae7
Closes-bug: #1439033
This change adds versions to the setup.cfg files of all the contrib
plugins, so that pbr can determine the plugin version when the plugins
are installed with pip. Because contrib plugins are not officially
supported, a version of 0.1 is used.
Change-Id: I7e55d7d018ecdbb878a22b236d75ecf87f7e3ed6
Closes-Bug: #1428879
Docker 1.5 and docker-py 1.0.0 support the read_only parameter when
starting containers(docker run --read-only).
By using this capability in combination with volumes, you can make sure
containers only persist data where it can be managed in a known location.
we should support it in the heat-docker
Change-Id: I6fdc3e46bb86b387a187f8fceb22997daed0a9f1
Closes-bug: #1430211
Add restart_policy, cap_add and cap_drop properties for stability and security.
Closes-bug: #1430197
Change-Id: Iec184fdf5c765217ff7058e8b1390b2f73c59b40
The oslo-incubator log modlule has been removed, so port to the oslo_log
library. Note this uses the new (non namespaced, e.g oslo.log) import
convention, we'll need to align other imports in a future commit.
Some import reordering was required due to pedantic H30[57] checks, and
the services have all been converted to initialize the oslo_log library
as this is done differently to the log.py in incubator.
Change-Id: Ib5a97123fe1b287bc531e42d7887c13ba6205628
Fix the HeatTestCase import issue as required by H302,
a following patch of https://review.openstack.org/#/c/129846/
Change-Id: Iab9a508682e9fe2932b7d00b191c8a4cdea4738b
Currently, Log translation is motivated by oslo's move to prioritized
translation of strings, as documented at
https://wiki.openstack.org/wiki/LoggingStandards#Log_Translation
- add log translation hints for warning, error and info levels
- move from LOG.warning to LOG.warn
- remove use of % as a string formatter, use the log functionality
instead
Partial implements blueprint log-translation-hints
Change-Id: I8dbb5430507283038939b5665d67615c46b1f72e
The Docker plugin incorrectly implements the 'volumes_from' option:
- The property is marked as a string when it should be a list, and
- The property needs to be passed to start_container rather than
create_container.
Change-Id: I617a4d29a9edbb45d80c7b8abb8f87eeaf795a8b
closes-bug: #1364041
closes-bug: #1364039
handle_delete and check_delete_complete were not handling NotFound
exceptions
Change-Id: I6e8100ff37157f6a06837307cea31af66a3403af
Closes-Bug: #1296758
This directory was renamed in 4e8231, which made importing docker
(that is docker-py) difficult if not impossible in Python 2.x. So
rename it to something other than 'docker' to avoid that problem.
(setup.cfg has been modified with the new path)
Change-Id: I3cbb7c5d4b53f70e1dc6102881f8e05852341a9a
Related-bug: #1296758