Commit Graph

583 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
Zuul c38c70f003 Merge "heat_docker: Require docker instead of docker-py" 2018-02-19 10:39:59 +00:00
Zane Bitter 13a5b43d65 Remove contrib/rackspace
These resources are unmaintained and (due to bug 1747775) untested.

Change-Id: I932368902abc9a32a4964c064abb49f16aadc1f3
2018-02-09 01:51:47 +00: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
ChangBo Guo(gcb) 381a84a4e8 Remove usage of parameter enforce_type
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
2017-05-08 17:55:32 +08: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
huangtianhua 27a99d537e Fix a small nit of docs
Change-Id: Ib06cc4b8ed95bbc80ab3a4fd7e03380e92ebf894
2017-01-04 11:17:21 +00:00
Jenkins b67d76d68b Merge "Add version keyword argument to RAX glanceclient" 2016-08-15 23:55:50 +00:00
Jason Dunsmore 891298e506 Add version keyword argument to RAX glanceclient
To match the signature of the OS glanceclient _create method.

Change-Id: I19ab0b19acf3f472e249c2211f08935116548de6
2016-07-15 15:07:10 -05:00
Jenkins 8a276a4483 Merge "Fix Cloud Server image/flavor combination validation" 2016-07-13 00:34:29 +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
Jenkins 47262c079d Merge "Sync context with oslo.context" 2016-06-29 02:41:26 +00:00
Jenkins baf386fde5 Merge "Correct the usage of properties.get() with default value" 2016-06-28 12:40:51 +00:00
huangtianhua ce78ba1462 Correct the usage of properties.get() with default value
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
2016-06-28 08:23:05 +00:00
Dmitriy Uvarenkov 558a8cd1e8 Correct message when extension is not available
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
2016-06-27 11:09:32 +03:00
gecong1973 7c389dd2a5 Fix some spelling mistakes in heat as follows:
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
2016-06-23 12:39:48 +08:00
Jamie Lennox 87a37f5db2 Sync context with oslo.context
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
2016-06-17 11:46:00 +10:00
Zane Bitter 5566e6f2c8 Get rid of gratuitous use of six.iterkeys()
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
2016-06-07 03:50:49 +00:00
Jason Dunsmore d8fefed177 Fix Cloud Server image/flavor combination validation
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
2016-05-18 19:55:04 +00:00
Jenkins 69874fc384 Merge "Unit tests: Don't use ResourceDefinition as cfn snippet" 2016-05-16 10:49:04 +00:00
Jenkins 99074df4b2 Merge "Don't treat ResourceDefinition as cfn template in resources" 2016-05-16 07:47:14 +00:00
Zane Bitter c64b2cd1f3 Break reference cycle in KeystoneClient plugins
Change-Id: Ie8ddd132c3ce02a01b77242ce86f219ce4f86249
Partial-Bug: #1570974
Related-Bug: #1508134
2016-05-13 11:30:22 -04: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
Zane Bitter f1751ae84c Don't treat ResourceDefinition as cfn template in resources
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
2016-05-01 19:25:24 -05:00
Zane Bitter f89cfcc662 Use the ResourceDefinition.Diff API in resources
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
2016-04-13 19:49:04 -04:00
Angus Salkeld 3ed5948b1c Set enforce_type=True on config overrides in tests
This makes sure that type checking is done by oslo.config
on the test override values.

Change-Id: Ia8c1cb55fe98e9d06b9b9ff13e5c2d25aa67bff3
Closes-bug: #1517839
2016-04-11 10:52:22 +10:00
Rabi Mishra 9305478141 Resolve name/id using translation rules for Server
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
2016-03-15 16:12:27 +05:30
Jenkins 9345e1648f Merge "Use oslo.utils.reflection to extract class name" 2016-03-06 05:01:48 +00:00
Jenkins f87c59b9c2 Merge "Add image/flavor validation to Rackspace Server" 2016-03-02 21:53:12 +00:00
Jenkins 1d6b4c8fcd Merge "remove containers on delete" 2016-03-02 04:15:53 +00:00
Jenkins 6e0b68b606 Merge "Make AutoScale sub-template a string instead of map" 2016-02-26 02:33:41 +00:00
Pratik Mallya 006db59851 Add image/flavor validation to Rackspace Server
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>
2016-02-22 12:51:13 -06:00
Jason Dunsmore c202c4447b Make AutoScale sub-template a string instead of map
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
2016-02-18 16:17:28 -06:00
Randall Burt 845dd17825 Force config_drive and transport for sw config
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
2016-02-17 14:11:45 -06:00
Bo Wang 4136b47666 Use oslo.utils.reflection to extract class name
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
2016-02-16 20:04:59 +08:00
Jason Dunsmore 268e6a10d6 Add support for launch_stack launchConfiguration type
Rackspace AutoScale Groups now support a "launch_stack"
launchConfiguration type.  This adds support to the
Rackspace::AutoScale::Group resource.

Change-Id: I20d2d9d4f317d726ccbb21275984f096ba300767
2016-02-15 11:43:56 -06:00
Jason Dunsmore 3ae796a0bc Remove extraneous fields from Cloud LoadBalancer access list
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
2016-02-04 11:29:17 -06:00
Jenkins 799467b08e Merge "Fix import order" 2016-02-02 04:46:06 +00:00
Bo Wang 34bc87e2c2 Fix import order
third-party lib before project imports.
refer to:http://docs.openstack.org/developer/hacking/#import-order-template

Change-Id: Ifeb38e337ac6ae5b385571284a808d51c916e6b6
2016-02-01 20:33:11 +08:00
Jason Dunsmore adfa6fa8e1 Assign defaults for Cloud Loadbalancer node type and weight
Without these defaults, the resource can get stuck in update until the
stack times out.

Change-Id: I58a5b70959e6107eefb4351d77315c0bceb9b717
Closes-Bug: #1539230
2016-01-28 14:22:13 -06:00
Jenkins c24dd96ade Merge "Add Rackspace::Cloud::LBNode" 2016-01-27 22:24:46 +00:00
Drago Rosson e94c70ced3 Add Rackspace::Cloud::LBNode
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
2016-01-27 13:41:14 -06:00