Commit Graph

146 Commits

Author SHA1 Message Date
Zuul 9d645d9713 Merge "reno: Update master for unmaintained/xena" 2024-03-12 14:38:29 +00:00
Zuul 9d900d8798 Merge "reno: Update master for unmaintained/wallaby" 2024-03-12 14:16:02 +00:00
Zuul 9a9ecaabb5 Merge "reno: Update master for unmaintained/victoria" 2024-03-12 13:13:23 +00:00
OpenStack Release Bot 89772fcc7f Update master for stable/2024.1
Add file to the reno documentation build to show release notes for
stable/2024.1.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2024.1.

Sem-Ver: feature
Change-Id: I53e658c9459b48f171670814af4de800d4e5ad2e
2024-03-08 14:22:30 +00:00
OpenStack Release Bot ed356c6934 reno: Update master for unmaintained/xena
Update the xena release notes configuration to build from
unmaintained/xena.

Change-Id: Id67960d0d6eb005aafd8ea1f0b4886f157b62a2f
2024-03-07 14:25:38 +00:00
OpenStack Release Bot f3461d6ca7 reno: Update master for unmaintained/wallaby
Update the wallaby release notes configuration to build from
unmaintained/wallaby.

Change-Id: I7c76882e8e796fb44126fb0572d888427b580582
2024-03-07 14:21:24 +00:00
OpenStack Release Bot 5c9243ef0a reno: Update master for unmaintained/victoria
Update the victoria release notes configuration to build from
unmaintained/victoria.

Change-Id: Iaa5e0d17151fd02414f2cb7544f49ec6d28b8450
2024-03-07 14:16:01 +00:00
OpenStack Release Bot a9d27925a0 reno: Update master for unmaintained/yoga
Update the yoga release notes configuration to build from
unmaintained/yoga.

Change-Id: I3e7b0ad53932deafce1b51de8a401ce37e2b4494
2024-02-06 14:28:02 +00:00
Zuul 4bcb132fbe Merge "Bump hacking" 2024-01-27 11:30:04 +00:00
Takashi Kajinami d85a3ad38c Bump hacking
hacking 3.0.x is too old.

Change-Id: I3c40ded7174691473e4ce36eb37da73707178f3c
2024-01-26 01:12:45 +09:00
Ghanshyam Mann e8d996e281 Update python classifier in setup.cfg
As per the current release tested runtime, we test
python version from 3.8 to 3.11 so updating the
same in python classifier in setup.cfg

Change-Id: I290f1611a4f7b77f544fdd1ca610c19770c9b2a0
2024-01-11 16:18:30 -08:00
Zuul 6be8940da5 Merge "Add openstack-cover-jobs to .zuul.yaml" 2023-12-19 19:32:23 +00:00
Zuul c321205073 Merge "Fix up tox -e cover to use coverage" 2023-12-19 13:11:27 +00:00
melanie witt a913005b9e Add openstack-cover-jobs to .zuul.yaml
Depends-On: https://review.opendev.org/c/openstack/oslo.limit/+/882072

Change-Id: I399e6fbef1969bcaf16c5c2a1513f3c35e38b10d
2023-10-06 18:55:07 +00:00
John Garbutt 027d5d263c Fix up tox -e cover to use coverage
Change-Id: I4516a958efd4b14a6d0f9f8a7763311f134c5215
2023-10-06 16:55:13 +00:00
Takashi Kajinami ba8b9aba0b Ensure endpoint_id is set
The endpoint_id option is required because it is the key to look up
the target endpoint from Keystone catalog. This ensures more sensible
error is shown in case endpoint id is not set, instead of trying to
look up endpoint by 'None'.

Change-Id: I43859dec08040130e4e5fa6ad65b74be21489aff
2023-10-06 11:00:35 +09:00
OpenStack Release Bot f28b01e652 Update master for stable/2023.2
Add file to the reno documentation build to show release notes for
stable/2023.2.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2023.2.

Sem-Ver: feature
Change-Id: I12738b4f4f252f2e6b7cbceb72487599e3b2775f
2023-09-07 09:36:52 +00:00
Hervé Beraud c9ee0adcbd Bump bandit
Change-Id: I63e59cae564a369a104b00866bfc0e5cad10b221
2023-05-19 14:43:53 +02:00
Ghanshyam fc64349bd7 Revert "Moves supported python runtimes from version 3.8 to 3.10"
This reverts commit 886e7170f1.

Keeping Python 3.10 in setup.cfg classifier and zuul.yaml changes.

Reason for revert:

Needed-By: https://review.opendev.org/c/openstack/openstack-zuul-jobs/+/882175

TC has been discussing about re-adding the python 3.8
testing in current master 2023.2 release testing.

- https://meetings.opendev.org/meetings/tc/2023/tc.2023-04-25-18.00.log.html#l-191
- https://lists.openstack.org/pipermail/openstack-discuss/2023-April/033469.html

While governance changes are under review, TC agreed to add py3.8 testing
so that we do not see more project/lib dropping python 3.8 and make them
uninstalable on python 3.8

- https://meetings.opendev.org/meetings/tc/2023/tc.2023-05-02-18.00.log.html#l-17
- https://review.opendev.org/c/openstack/governance/+/882165

Also adding py3.8 testing back in job https://review.opendev.org/c/openstack/openstack-zuul-jobs/+/882175

Change-Id: I79df2b9500be5269ecd9894ed4cf46a5edb1592a
2023-05-05 18:53:49 +00:00
Hervé Beraud 886e7170f1 Moves supported python runtimes from version 3.8 to 3.10
Within 2023.2 python version 3.9 and 3.10 are the
supported python runtimes [1].
[1] https: //review.opendev.org/c/openstack/governance/+/872232

Change-Id: I47b536149e8119324b3b715b2103b803b74a8a56
2023-04-10 13:06:20 +09:00
OpenStack Release Bot de69de18ab Update master for stable/2023.1
Add file to the reno documentation build to show release notes for
stable/2023.1.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/2023.1.

Sem-Ver: feature
Change-Id: Ic252a5812db3bc3c243d0cee91c7ab85646a9e66
2023-02-24 15:18:42 +00:00
OpenStack Release Bot ee1d1aadd0 Add Python3 antelope unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for antelope.

See also the PTI in governance [1].

[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html

Change-Id: If0a66f70fee2e3b1451bdb3ede036f38413f148f
2022-09-09 09:16:49 +00:00
OpenStack Release Bot 36731d8f8a Update master for stable/zed
Add file to the reno documentation build to show release notes for
stable/zed.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/zed.

Sem-Ver: feature
Change-Id: I794dc8f558497de66535cd6b97a4ccd54480fa1e
2022-09-09 09:16:48 +00:00
Hervé Beraud beb080d1a2 Fix formatting of release list
Change-Id: I0a7d70a24c527a03930887d4d1ee1214462c8de3
2022-05-27 12:11:59 +02:00
Hervé Beraud 992be2042c Drop python3.6/3.7 support in testing runtime
In Zed cycle testing runtime, we are targetting to drop the
python 3.6/3.7 support, project started adding python 3.8 as minimum,

example nova:
- 56b5aed08c/setup.cfg (L13)

Also indicates that we support python 3.9.

Change-Id: I206acb8e50a404e76766daf7439aed258ccfa499
2022-05-05 16:16:16 +02:00
Zuul 6451b4f61e Merge "Move Enforcer caching closer to limit retrieval" 2022-04-05 11:45:19 +00:00
Zuul 4a4d087110 Merge "Add Python3 zed unit tests" 2022-03-22 15:09:36 +00:00
melanie witt c67c9cf0df Move Enforcer caching closer to limit retrieval
In change I22234e0bb6b3a1cecb29a6b99a3afcd02ffdbf5f added a
get_registered_limits() interface but missed making it work with the
Enforcer cache because caching was implemented in a higher layer,
_get_limit() and get_registered_limits() could not make use of
_get_limit().

This moves the caching logic to where limits are retrieved from
keystone, so that get_registered_limits() will use caching and any
interfaces that might be added in the future will be able to benefit
from using the cache.

Closes-Bug: #1964848

Change-Id: I28cdd4d3f4927b94acea3309b36999850cf2ee2a
2022-03-15 01:21:07 +00:00
Zuul 562ada0e2d Merge "Add documentation for config options" 2022-03-08 18:38:00 +00:00
Zuul 45e01c9071 Merge "oslo-config-generator: Fix ValueError" 2022-03-08 18:37:58 +00:00
OpenStack Release Bot 004809a850 Add Python3 zed unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for zed.

See also the PTI in governance [1].

[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html

Change-Id: I51c6dd2064f8da833c1302db9b42858db9d5ada8
2022-03-04 17:18:13 +00:00
OpenStack Release Bot a6e08b0dce Update master for stable/yoga
Add file to the reno documentation build to show release notes for
stable/yoga.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/yoga.

Sem-Ver: feature
Change-Id: Ifd733042b819aa64c417730b5587140700595a30
2022-03-04 17:18:12 +00:00
melanie witt 9f7a66a273 Add documentation for config options
This adds a doc page for oslo.limit config options by auto-generating
them.

Change-Id: I49070fdbf2172f87bafd4d2bd08af282c9ef29a4
2022-03-03 00:32:47 +00:00
Takashi Kajinami ce5aa7dcca oslo-config-generator: Fix ValueError
This fixes how the opts data is formatted to fix auto-generation of
config file using oslo-config-generator with oslo.limit entry point.

Closes-Bug: #1962406
Change-Id: I176a7b2b8e2edb50659783a2139c3cc13e8f2f53
2022-02-28 01:27:50 +09:00
melanie witt bf9deb10c3 Add interfaces for getting limits without enforcing
We currently have a public Enforcer interface for getting limits and
calculating usage but it is not yet possible to retrieve only limits
without calculating usage.

While working on unified limits support in nova, we realized we need a
way to get limits only. In nova there are legacy APIs for showing quota
limits and initially we will provide compat by proxying to keystone to
get the limits.

This adds public interfaces for getting limits to Enforcer.

Related to blueprint unified-limits-nova

Change-Id: I22234e0bb6b3a1cecb29a6b99a3afcd02ffdbf5f
2022-01-21 19:35:33 +00:00
Dan Smith 7e4f36abdb Allow project_id=None for enforce/calculate
This allows a caller to pass None for the project_id if it only wants
it to check the registered limit for a given resource. This is useful
for non-project-scoped resourced where we just want to make sure some
global limit hasn't been exceeded. This would also be relevant for
resources that are created by system-scoped users, such as host
aggregates.

Change-Id: I5fea0143b6a96b5f79bc273961e3e284a260e25e
2022-01-21 19:35:26 +00:00
Dan Smith a49f3a04d0 Make calculate_usage() work if limits are missing
The calculate_usage interface was added recently to allow consumers
to probe limits and usage without requiring the enforce behavior
workflow. If a limit was passed to it that was not registered in
keystone, get_project_limits() would raise a ProjectOverLimit
exception itself to abort the process immediately, providing the
"unregistered means zero" behavior. This works fine for the enforce
workflow, but not the calculate one.

This changes get_project_limits() to just return a zero limit for
a missing one, which will be considered by the enforce workflow in
the same way, keeping the existing behavior. It will merely be
reported by the calculate workflow, which is the desired change.

Change-Id: Iaab1f0d5eb0da9a667267537d86f6c70bc8db51d
2022-01-10 13:44:01 -08:00
Zuul ca8df2af67 Merge "Add auth plugin options to options list" 2022-01-10 13:33:50 +00:00
Zuul 36b9ca3ccd Merge "Add caching of limits in Enforcer" 2022-01-10 13:11:46 +00:00
melanie witt 43683f543e Add caching of limits in Enforcer
This adds caching of resource limits for an Enforcer in order to
improve performance when repeated limit checks are needed. The cache
lasts the lifetime of an Enforcer and is enabled by default. It can be
disabled by passing cache=False when instantiating an Enforcer.

One usage pattern for a caching Enforcer would be to create an Enforcer
per service request so that the caching lives only as long as the
request.

Change-Id: I8e43dceec76aecd2b2ae23a137e56519efe29777
2021-10-18 21:43:57 +00:00
Takashi Kajinami ea5ff2dc12 Add auth plugin options to options list
Currently the oslo.config.opts entry_points provided by oslo.limit
doesn't include options for auth plugins, thus the parameters to
define credentials like username, password and etc are not picked up by
oslo-config-generator.

This adds the options for auth plugin options to the entry point so
that the auth parameters are included by the generated config files
and users can easily find the parameters to define the required user
credential.

Note that keystoneauth provides several plugins but this change covers
only password plugins, assuming the password authentication is most
popularly used.

Change-Id: Ib440f58b589076677be9e90dd960cd4459e63746
2021-10-12 08:37:37 +09:00
Zuul a6fff3be31 Merge "Changed minversion in tox to 3.18.0" 2021-10-05 12:00:00 +00:00
Zuul 4b53ff402f Merge "setup.cfg: Replace dashes with underscores" 2021-10-04 18:15:04 +00:00
OpenStack Release Bot 489feb55c1 Add Python3 yoga unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for yoga.

See also the PTI in governance [1].

[1]: https://governance.openstack.org/tc/reference/project-testing-interface.html

Change-Id: Ic2bf80ec8f183476facb9710be968050641532e0
2021-09-10 14:34:52 +00:00
OpenStack Release Bot e60489fb07 Update master for stable/xena
Add file to the reno documentation build to show release notes for
stable/xena.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/xena.

Sem-Ver: feature
Change-Id: If079ffb950122121a9cd9254cce28bf62106ed57
2021-09-10 14:34:50 +00:00
wangzihao a7d8f4119b setup.cfg: Replace dashes with underscores
Setuptools v54.1.0 introduces a warning that the use of
dash-separated options in 'setup.cfg' will not be supported
in a future version [1].
Get ahead of the issue by replacing the dashes with underscores.
Without this, we see 'UserWarning' messages
like the following on new enough
versions of setuptools:

UserWarning: Usage of dash-separated 'description-file' will not be
supported in future versions. Please use the underscore name
'description_file' instead
[1]https://github.com/pypa/setuptools/commit/a2e9ae4cb

Change-Id: I2ea9570dcf018c484054d8078f6e5a767b23dd82
2021-08-13 01:06:07 +00:00
wangzihao a625860dde Changed minversion in tox to 3.18.0
The patch bumps min version of tox to 3.18.0 in order to
replace tox's whitelist_externals by allowlist_externals option:
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: I1d65fb9d8d302ff1e3f33e92b668b2241741e7e0
2021-08-12 11:12:28 +08:00
Dan Smith caa75c1bab Add a test fixture
This adds a fixture that can be used by consuming projects to
simulate a set of limits in keystone, without requiring actual
keystone. Currently, consumers have to mock oslo.limit internals (at
least) in order to do testing.

Change-Id: If72050e90ca8b03e26d128c7bbcef6bbea92b501
2021-06-09 08:04:01 -07:00
Dan Smith 1175b0f7c1 Add Enforcer.calculate_usage()
In multiple situations, it is necessary to be able to probe the limits
set for a project without actually enforcing. Examples:

1. Exposing a usage API where we want to not only report the current
   usage, but the limit as well. Otherwise clients have to do their
   own calls to keystone and correlation to get a single integer
   limit value, which we should be able to expose for them.
2. When checking quota as part of a long-running process of consuming
   an unbounded data stream, we need to be able to determine how much
   quota remains so that we can stop the transfer if we exceed the
   limit. Without this, we have to periodically call to keystone
   during the transfer, which is expensive and could fail.

This patch adds a calculate_usage() method to the Enforcer which
calculates the usage using the enforcement model and returns a
mapping of resource names to namedtuples that contain limit and usage
information.

Change-Id: Ic0632cc5ec52aefb85a04f879651963bfa54dcbe
2021-06-07 08:47:38 -07:00
wu.shiming efc26ae724 Upgrade the pre-commit-hooks version
[1] 9136088a24

Change-Id: I45f42b47cb3ba45416dc7e4325b4efd635df4a92
2021-05-18 11:11:24 +08:00