Commit Graph

44 Commits

Author SHA1 Message Date
Stephen Finucane
60fb3cda60 Replace use of distutils.version
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
2023-06-19 10:45:58 +01:00
Sean McGinnis
fd6cf83554
Use unittest.mock instead of third party mock
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>
2020-05-05 08:42:11 -05:00
Hervé Beraud
991e967846 Remove six and python 2.7 full support
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
2020-04-22 12:23:44 +02:00
ZhongShengping
e675ae10f1 Update devel info: mailing list
The new openstack-discuss mailing list is going to replace few
mailing lists, including openstack-dev.

Change-Id: I5d5f87614f692444728eb204f8d794e80179a4c8
2018-12-05 09:02:33 +08:00
Zuul
7d4b0e2adb Merge "Docs: modernise links" 2018-04-27 11:36:18 +00:00
Zane Bitter
3f98c3d6fb Docs: modernise links
Switch to https, replace outdated URLs with canonical ones.

Change-Id: I7c474dbf0b21f922b6625e31d6ae7df1e198b8de
Co-Authored-By: chenghuiyu <yuchenghui@unionpay.com>
Co-Authored-By: Max Pavlukhin <pavlukhinm@gmail.com>
Co-Authored-By: yfzhao <dsware@126.com>
Co-Authored-By: ricolin <rico.lin@easystack.cn>
2018-04-11 16:46:07 -04:00
ricolin
1e3ddf11ff Remove mox usage from test_docker_container
Change-Id: I331dfd937efad0dafed3aaa29b2d5a3d9741a4a6
goal: mox-removal
2018-04-01 22:48:35 +08:00
ricolin
d00a068c5b Fix broken test in DockerContainerTest
Change-Id: I5b72684ff913c936943a37310fbea2b9684ef180
2018-04-01 22:48:17 +08:00
Thomas Bechtold
e7cde3b2e5 heat_docker: Require docker instead of docker-py
docker-py was renamed to docker. Use docker with the version mentioned
in global-requirements.
Also docker.Client was renamed to docker.APIClient (see [1]).

[1]
https://docker-py.readthedocs.io/en/stable/change-log.html#breaking-changes

Change-Id: I041727c1817c55be5265cc77d6ab9b5db5bf5dcf
2018-01-12 16:21:51 +01:00
liyi
8f10215ffd 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: Ieec8028305099422e1b0f8fc84bc90c9ca6c694f
2017-03-25 17:11:50 +08:00
Luong Anh Tuan
78d1f4ccc8 Remove py26 support
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
2017-01-23 05:52:41 +00:00
gengchc2
61bda3a08a modify the home-page info with the developer documentation
update home-page info

Change-Id: I31dc89c89fae5a8128c55802713a80c43df243ef
2016-07-29 09:34:10 +08:00
Zane Bitter
23cc15687b Unit tests: Don't use ResourceDefinition as cfn snippet
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
2016-05-01 19:42:20 -05:00
Jenkins
1d6b4c8fcd Merge "remove containers on delete" 2016-03-02 04:15:53 +00:00
LiuNanke
208d2debd0 Using LOG.warning replace LOG.warn
*Python 3 deprecated the logger.warn method, see:
*https://docs.python.org/3/library/logging.html#logging.warning
*so we prefer to use warning to avoid DeprecationWarning.

Change-Id: I07ee9c97c3548c965aaf83d34b37b23e9baba584
2015-12-29 09:32:42 +00:00
Lars Kellogg-Stedman
363c0d148d remove containers on delete
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
2015-12-09 19:34:04 -05:00
Jiří Suchomel
b78f5189d1 Remove default value for mem_limit to keep up with docker-py
Change-Id: I04d9be374de7bf00cf89cc6e24aa749cb6686a16
Closes-Bug: 1521109
2015-11-30 11:08:10 +01:00
Sirushti Murugesan
298055dc48 py34: contrib resources
partial blueprint heat-python34-support

Change-Id: I39b1cf5007a9dae599954054dd9a3ec0472900b6
2015-09-22 22:50:23 +05:30
Rakesh H S
1956ddd2a6 Convergence: Store resource status in cache data
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
2015-09-14 17:29:18 +05:30
Oleksii Chuprykov
6d41bcc1d3 Move Resource exceptions to common module (3)
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
2015-09-04 11:24:41 +00:00
Doug Hellmann
423110ef6e Update version for Liberty
Update the version for Liberty, switching from date-based versioning
to pre-versioning using SemVer. See
http://lists.openstack.org/pipermail/openstack-dev/2015-May/065211.html
and
http://lists.openstack.org/pipermail/openstack-dev/2015-June/067082.html
for details.

Also new version was updated in resources with SupportStatus version 2015.2.

Change-Id: I6a35fa0dda798fad93b804d00a46af80f08d475c
2015-06-22 04:13:01 -04:00
Miguel Grinberg
df48be8809 Add support_status to all resources in contrib
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
2015-06-04 17:16:38 -07:00
Zane Bitter
203b8e8ecf Retain references to stacks in all unit tests
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
2015-05-14 16:55:12 -04:00
Steve Baker
bb4c915434 Do not specify version for contrib plugins
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
2015-05-04 10:33:23 +12:00
LiangChen
519efffdb0 Docker plugin add cpu set property
Change-Id: I96763d0bc293baee044f79d0bc3123adf40c0728
Closes-bug: #1439042
2015-04-21 14:49:28 +08:00
LiangChen
3c4ecc24c5 Docker plugin add host devices property
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
2015-04-14 11:38:20 +08:00
Jenkins
e53b3ff73b Merge "Docker plugin add cpu share property" 2015-04-13 13:17:14 +00:00
LiangChen
41437ff8a3 Docker plugin add cpu share property
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
2015-04-13 19:16:43 +08:00
LiangChen
956adeb0ec Docker plugin add the 'support_status' for the properties of
'RESTART_POLICY','CAP_ADD' and 'CAP_DROP'

Change-Id: If52d4f216535f0b9b8efea35d5eef54a5e91cd77
Closes-bug: #1442444
2015-04-10 10:58:30 +08:00
Miguel Grinberg
428e6b75a7 Add versions to all contrib plugins
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
2015-03-27 19:03:06 -07:00
LiangChen
3944fe1c7f Docker plugin add read_only property
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
2015-03-25 18:38:42 +08:00
LiangChen
7dfc576736 Docker plugin add restart policies and capability properties
Add restart_policy, cap_add and cap_drop properties for stability and security.

Closes-bug: #1430197

Change-Id: Iec184fdf5c765217ff7058e8b1390b2f73c59b40
2015-03-17 20:29:55 +08:00
Jens Rosenboom
a99fe6a760 Make import of oslo libraries namespaceless
See https://blueprints.launchpad.net/oslo-incubator/+spec/drop-namespace-packages

Closes-Bug: 1423174
Change-Id: I48680ce6e7ce91005c147ab4388203946171d433
2015-02-18 22:54:10 +01:00
Steven Hardy
70112c103a Move logging to use oslo_log library
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
2015-02-17 09:23:34 +00:00
Randall Burt
0f368be6b9 Detect container failure when checking create complete
Change-Id: I77f56ec544a82e13cd5a00a3adcfde6c0dda822e
2014-11-20 10:23:46 -06:00
Peter Razumovsky
16fc1fff93 Fix [H302] errors in contrib
Change-Id: I356753e791e574ee45b3b254aaeb80b242e13b23
2014-11-14 15:02:01 +03:00
Zhenguo Niu
09ecdc55a0 Don't import HeatTestCase directly
Fix the HeatTestCase import issue as required by H302,
a following patch of https://review.openstack.org/#/c/129846/

Change-Id: Iab9a508682e9fe2932b7d00b191c8a4cdea4738b
2014-10-22 14:15:11 +08:00
liu-sheng
7a786674f7 Log translation hint for Heat.contrib
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
2014-10-15 10:25:50 +08:00
Julien Danjou
6519cf36fd Switch to oslo.utils
Change-Id: I74979d8f75b099858314a30c98bb252c379e0304
2014-09-30 14:27:59 +02:00
Ethan Lynn
6d0cd62172 Switch heat resources & db & tests to oslo.i18n
Use oslo.i18n in resources & db & tests directories.

blueprint oslo-i18n

Change-Id: Idaf718b9d762b9ae89d6045557eadb758b552bd5
2014-09-17 14:28:56 +08:00
Jenkins
eca7ad1c21 Merge "Improve docker resource deletion" 2014-09-04 18:48:57 +00:00
Lars Kellogg-Stedman
03638b3e73 correctly implement volumes_from property
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
2014-09-01 11:34:52 -04:00
Jeff Peeler
ebc6cd9a26 Improve docker resource deletion
handle_delete and check_delete_complete were not handling NotFound
exceptions

Change-Id: I6e8100ff37157f6a06837307cea31af66a3403af
Closes-Bug: #1296758
2014-08-29 09:19:55 -04:00
Jeff Peeler
69c662ac24 Rename docker directory to heat_docker
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
2014-08-28 23:42:24 -04:00