Commit Graph

18 Commits

Author SHA1 Message Date
Zuul c2f8834656 Merge "Use zoneinfo instead of pytz if available" 2024-02-20 09:01:22 +00:00
Takashi Kajinami 564507a72a Stop using deprecated implicit_prefix option
This argument was deprecated in netaddr 0.10.0[1], and was removed in
netaddr 1.0.0[2].

[1] aca2f56344
[2] cc42742247

Change-Id: I24f26ee44af8fdfca89312351e67e5edbf7c81de
2024-02-17 13:13:34 +09:00
Takashi Kajinami 84ca8a18e0 Use zoneinfo instead of pytz if available
The zoneinfo module was introduced in Python 3.9. We can use that
built-in module instead of the 3rd party library (pytz).

This is based on change I1f88bdadc68bfa726eac1da1c5824c1ed352ad98 in
oslo.utils.

Change-Id: I539120a6bfb850b0c4e384e51caa021761a4f6b8
2024-01-27 19:23:00 +09:00
Hervé Beraud 6ccd16cc32 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 5 of a serie of 28 patches

Change-Id: Idb037ded55698790fc1658896f1e2dcdce89f3f9
2020-04-22 12:23:44 +02:00
Tom Stappaerts 5e93b3e4cf Fix allowed address pair validation
Neutron requires the allowed address pair ip address to be
either an ip or a cidr.
https://review.opendev.org/#/c/575265/ made heat verify for
cidr only.

Change-Id: I2cc2785cb32cf8d788af6262992b1b76107c8292
Story: 2005674
Task: 30985
2019-05-15 13:06:36 +02:00
Nakul Dahiwade 9592bcb591 Enhancements to CIDR and IP address constraints.
Currently the constraints do not reject an ipaddress for ipv4 which have
fewer than 3 dots such as 'a' or 'a.b' or 'a.b.c'.
This enhancement provides an extra check that an ipv4 address has syntax:
'a.b.c.d'

This also applies to CIDR

Change-Id: Ia7ec8bf107abd169b6b6a91d0b8bb913fc3cc7b9
Story: 2002552
Task: 22114
2018-07-25 18:11:10 +00:00
Zane Bitter c26f367b03 Remove broken heat.resource_type custom constraint
This reverts the commits f5c32ad8fd and
14fdf72b000c82a80abb2587189dd7c6c7dfa0a0e.

The constraint never worked and the stuff to pass the template to
constraints (which was broken because we actually passed a
ResourceDefinition instead) is a pain. Just get rid of it rather than
fix it.

Change-Id: I4e1e787ad94ac1951f472ea066a9b1c9d3e03611
Closes-Bug: #1661403
2017-08-01 13:35:16 -04:00
Dmitriy Uvarenkov 70422e6de4 New common constraint 'Expiration'
Checks if expiration date is bigger than actual date.

Change-Id: Iccbd2e691400b64beb65c3a4a22a01aa0d384d32
2016-08-01 12:43:42 +03:00
rabi 5797d34ccd Add dns constraints
This adds constraints to be used with properties of neutron
resources for internal/external dns resolution.

Change-Id: I728eec876b9f5e12b92ee8283c0d1a7610d7ed76
Blueprint: neutron-dns-resolution
2016-07-26 10:01:06 +05:30
Ana Krivokapic db51ae19dc Fix validate method definitions
A new argument was added to the validate method of the BaseCustomConstraint
class but the corresponding methods of its subclasses were not fixed to reflect
that. This patch amends the subclass methods to add the new argument.

Change-Id: I166463ec0db9fb01a2eaf0337a3307c854dffc51
2016-07-15 12:50:15 +02:00
Jay Dobies f5c32ad8fd Added heat.resource_type custom constraint
This constraint will validate that a parameter value is a valid resource
type within the context of the template (that is, taking into account
the environment file(s) passed in as well).

Change-Id: I82b18d52982c2731370df9ea4ea0e398bf7702f2
Closes-Bug: #1545857
2016-06-20 16:05:30 -04:00
Sergey Kraynev fbb1a49424 Add test for performance in constraint validation
There are follow important changes in patch:
 - New constraint was added. This constraint emulate delay during
   resolving custom constraint for property.
 - New property was added for TestResource. This property uses new
   constraint.
 - Added Rally scenario create-delete, which uses template with
   ResourceGroup of TestResources with custom constraint.


Depends-On: I06183138d54c1cb971a58a158a15f3f5b25cba4d

Change-Id: I53d83f59be9bd27db451f87aaae2d8446f287c17
2016-02-12 16:05:33 +00:00
Julien Danjou 2406da4fd3 Remove iso8601 dependency
The parse_isotime() from oslo.utils does exactly that in a slightly
better way, so no need to use that one here.

Change-Id: I1bf7f60f2bf8e5848a2a1f3a2a55b6d379641900
2015-09-03 16:39:54 +02:00
ricolin 7c941a38af move ceilometer constraints to common constraint
seperate out common ceilometer constraints

Change-Id: Ia562afe7fed57a3698fae9dbe11149988583bdc0
2015-08-03 13:18:31 +08:00
ricolin 3f68d5485e move network constraints from neutron to common constraint
seperate out common network constraints (ip_addr, cidr, and mac_addr)

Change-Id: I617035e379c4e86ac0ce4c77f26ebfca5b3d691a
2015-08-03 12:56:34 +08:00
Jenkins e3608159cd Merge "collect common constraints" 2015-08-03 03:54:18 +00:00
ricolin 35a866ca83 collect common constraints
Create directory for common constraints and collect constraints.

Change-Id: Ie0800baa5415a71b67ede22313b0d57b198e8dc4
2015-08-02 00:32:07 +08:00
ricolin 943ccd2937 add new constraints to ceilometer
Add timezone and cron_expression constraints.
this is required by time_constraints in Ceilometer alarm resources.
Change-Id: I2b348d9eb0f1d1ebf1407dbaeeb975dfa86b40d5
Partial-Bug: #1447942
2015-08-01 01:03:41 +08:00