2838 Commits

Author SHA1 Message Date
yangyawei
daca25497c 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: I6e015bf3955e3ff7aa21bc86d3f6f69e0017ca29
2021-05-13 20:29:03 +08:00
dengzhaosen
39826f06f1 Remove the oslo_utils.fnmatch
Oslo.utils's fnmatch module was added to fix the py2.7 fnmatch module
who was not thread safe [1]. Python 2.7 is no longer supported so now we
can use the stdlib's fnmatch module and deprecate the one of oslo.utils.

[1] https://bugs.python.org/issue23191$

Change-Id: Id5381a0a5216783f0df594b126786947db16a8d1
2021-05-11 01:02:11 +00:00
Jorhson Deng
355e0bd79b Remove references to 'sys.version_info'
We support Python 3.6 as a minimum now, making these checks no-ops.

Change-Id: I2cd6d5272eeacbda91e389efb1cfaaadf376d767
2021-04-28 09:49:56 +08:00
Zuul
219ab13705 Merge "Fix formatting of release list" 2021-04-16 13:11:27 +00:00
Zuul
3996d11b80 Merge "bindep: Add 'librdkafka-dev' dependency" 2021-04-16 13:11:15 +00:00
Pierre Riteau
a5ad998b12 Fix formatting of release list
Change-Id: I1f859a964de7f96e5decdec0977faa355b6a2a60
2021-04-16 11:29:44 +01:00
Zuul
a43e6c6024 Merge "Add Python3 xena unit tests" 2021-04-15 21:20:05 +00:00
Zuul
8b71832947 Merge "Update master for stable/wallaby" 2021-04-15 19:12:29 +00:00
Kenneth Giusti
f43a70687c Move flake8 as a pre-commit local target.
The goal here is to avoid conflicts between flake8 and hacking version each
2 days.

Inspired from nova's approach[1].

The flake8 version to install will be determined by hacking and
requirements[2] will stay aligned instead of relying on different versions.

[1] https://opendev.org/openstack/nova/src/branch/master/.pre-commit-config.yaml#L26-L35
[2] https://opendev.org/openstack/hacking/src/branch/master/requirements.txt#L1

Co-authored-by: Daniel Bengtsson <dbengt@redhat.com>

Change-Id: I3d2e95c783cb0ca88ea8657acd9f262ea9244e9d
2021-04-13 12:23:56 +02:00
83d0e45307 Add Python3 xena unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for xena.

See also the PTI in governance [1].

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

Change-Id: I0be0881612b74a6d003616ee7747e303939be11f
2021-03-18 11:20:42 +00:00
bddf53109e Update master for stable/wallaby
Add file to the reno documentation build to show release notes for
stable/wallaby.

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

Sem-Ver: feature
Change-Id: I2deb189cfdd7420e69060cd89c45b03b43c211af
2021-03-18 11:20:30 +00:00
Zuul
5aa645b38b Merge "Remove lower constraints." 2021-02-12 11:21:16 +00:00
Zuul
11a49a0a3e Merge "Correctly handle missing RabbitMQ queues" 2021-02-09 18:01:29 +00:00
Daniel Bengtsson
e52dc2accf Remove lower constraints.
Remove the lower constraints file and the
tox environment for lower constraints.

Change-Id: Iefa00bee6f67e9e82f0c703a7aff144c0dcbe1ec
2021-02-05 13:08:03 +01:00
Hervé Beraud
4937949dff Correctly handle missing RabbitMQ queues
Currently, setting the '[oslo_messaging] direct_mandatory_flag' config
option to 'True' (the default) will result in a 'MessageUndeliverable'
exception being raised when sending a reply if a RabbitMQ queue is
missing [1]. It was the responsibility of the application to handle
this exception, however, many applications are not doing so. This has
resulted in a number of bug reports.

Start handling this error condition, using a retry loop to attempt to
resend the message and work around any temporary glitches. Since
attempting to send a reply will will no longer raise an exception,
there is little benefit in retaining the '[oslo_messaging]
direct_mandatory_flag' config option: users setting this to False will
simply not benefit from the retry logic and improved logging added
here. This option is already deprecated though and will be fully
removed in a future release.

[1] https://www.rabbitmq.com/channels.html

Change-Id: Id5cddbefbe24ef100f1cc522f44430df77d217cb
Closes-Bug: #1905965
2021-02-04 09:47:08 +00:00
Zuul
38a06028f2 Merge "Move jobs to py38" 2021-02-03 16:52:10 +00:00
Zuul
11e13abf9b Merge "remove unicode from code" 2021-02-03 15:04:07 +00:00
Zuul
3b26a60c92 Merge "Remove six" 2021-02-03 14:44:10 +00:00
Zuul
e18553f505 Merge "Deprecate the mandatory flag" 2021-02-01 16:47:19 +00:00
Hervé Beraud
2b89d97888 Deprecate the mandatory flag
It will not be possible to deactivate this functionality anymore.

Change-Id: I1cbafff03349f7da9224de46285707fbf2a81a68
2021-02-01 10:31:16 +01:00
Zuul
0e7ac7d29e Merge "Use py3 as the default runtime for tox" 2021-01-18 16:20:22 +00:00
Zuul
2bc8b9d904 Merge "fix variable name" 2021-01-08 14:15:12 +00:00
Zuul
e97ad18706 Merge "Use TOX_CONSTRAINTS_FILE" 2021-01-08 13:56:37 +00:00
Zuul
7f823b406e Merge "Fix type of direct_mandatory_flag opt" 2021-01-06 18:30:08 +00:00
xuanyandong
642367cdfd remove unicode from code
Change-Id: Ib2b816728307166450a4cea2ccdb3c4b550a0713
2021-01-03 16:11:46 +08:00
xuanyandong
5560e8e671 Remove six
Change-Id: I9ac8671d9a37c218cb0e5546eb6dbcec7a7a764e
2021-01-02 10:41:25 +08:00
Ben Nemec
b8f8b17030 Fix type of direct_mandatory_flag opt
An IntOpt with a default of True is invalid. I'm a little surprised
this doesn't fail a defaults check somewhere, but it needs to be
fixed regardless.

Looking at where it is used, it appears the boolean type is correct.
This just changes the opt type to BoolOpt to match.

Change-Id: I01a38754a31c891f2b3b9c7f8135690693df5d13
Closes-Bug: 1909036
2020-12-22 19:36:14 +00:00
Hervé Beraud
686a8b6182 Dropping lower constraints testing
We facing errors related to the new pip resolver, this
topic was discussed on the ML and QA team proposed to
to test lower-constraints [1].

I propose to drop this test because the complexity and recurring pain needed
to maintain that now exceeds the benefits provided by this mechanismes.

[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019390.html

Change-Id: Icf48ef72fbfff88dda2714b386dbbfe355dc1acb
2020-12-18 15:09:42 +01:00
Hervé Beraud
f16892ea48 Move jobs to py38
Change-Id: I5e7e3f84519770e39754338ea4968fa6cd3ee6f6
2020-12-16 11:05:26 +01:00
Hervé Beraud
0e4ec379c0 fix variable name
Change-Id: I6039d09533c86d651b5c63b500058aac3c9f0a7f
2020-12-11 15:31:42 +00:00
Hervé Beraud
54f8724be2 Fix doc title rendering
Change-Id: I9532f28a84b206c6268ead94c574aacb6216df6a
2020-12-04 11:16:41 +01:00
Hervé Beraud
7a83dcd588 Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

[1] https://review.opendev.org/#/c/722814/
[2] https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file

Change-Id: I93bab5b1e77e720cbf308a97a9605a9dc98025a0
2020-11-04 10:49:02 +01:00
Hervé Beraud
672c00a67d Use py3 as the default runtime for tox
Moving on py3 as the default runtime for tox to avoid to update this at
each new cycle.

Wallaby support officially the following runtimes [1]:
- Python 3.6
- Python 3.8

During Victoria Python 3.7 was used as the default runtime [2] however this
version isn't longer officially supported.

[1] https://governance.openstack.org/tc/reference/runtimes/wallaby.html#python-runtimes-for-wallaby
[2] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-victoria

Change-Id: I2c517401aa1ae464e6563800ecb0a459076655b3
2020-11-04 10:02:47 +01:00
Thomas Goirand
0c4203bbdc Python 3.9: isAlive is removed
The Threading method isAlive was deprecated a long time ago, in the favor
of is_alive(). Though in Python 3.9, isAlive is removed. We must switch
to it. Note that is_alive() is available at least in Python 3.5 (I tried)
and probably even earlier, so switching to is_alive() is not a problem
for the Python interpreter versions currently supported by OpenStack.

Change-Id: I9d671abcd2cea9c0c726edaddcd65e1093d96731
2020-10-16 09:45:36 +02:00
Zuul
2cc35f6b1a Merge "Run rabbitmq heartbeat in python thread by default" 2020-10-15 17:53:23 +00:00
Sean Mooney
00d15eaeab add min of 1 to rpc_conn_pool_size
This change add a min value of 1 to
[oslo_messaging_rabbit]/rpc_conn_pool_size
such that there is always at least 1 connection avaiable.

This change add a runtime check to ensure that
[oslo_messaging_rabbit]/rpc_conn_pool_size is greater than
or equal too [oslo_messaging_rabbit]/conn_pool_min_size

Change-Id: I2ad4b9f1d012c9f0586a932ac27d96da1bcc4e4c
Closes-Bug: #1899533
2020-10-13 12:44:30 +01:00
Hervé Beraud
a997f09e5b Adding pre-commit
Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit hooks.
- Applying fixes for pre-commit compliance in all code.

Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.

pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker (check-byte-order-marker);
- Checks that non-binary executables have a proper
  shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings (check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
  calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)

For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks

Change-Id: Ibd0c3d64fdc5c293d9d676d33eab828d9fde971f
Co-authored-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-22 12:35:37 +02:00
4bae96d7f7 Add Python3 wallaby unit tests
This is an automatically generated patch to ensure unit testing
is in place for all the of the tested runtimes for wallaby.

See also the PTI in governance [1].

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

Change-Id: I156ddad2cf69663d24bdcb6500386a33aab72a31
2020-09-11 20:58:51 +00:00
633383babb Update master for stable/victoria
Add file to the reno documentation build to show release notes for
stable/victoria.

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

Change-Id: I0e5758da8c95474b1ddda5419f80ae94da71d147
Sem-Ver: feature
2020-09-11 20:58:48 +00:00
Zuul
62e104bdb5 Merge "[goal] Migrate testing to ubuntu focal" 2020-09-11 01:57:32 +00:00
Ghanshyam Mann
a21c96ec0e [goal] Migrate testing to ubuntu focal
As per victoria cycle testing runtime and community goal[1]
we need to migrate upstream CI/CD to Ubuntu Focal(20.04).

Fixing:
- bug#1886298
Bump the lower constraints for required deps which added python3.8 support
in their later version.

Story: #2007865
Task: #40207

Closes-Bug: #1886298

[1] https://governance.openstack.org/tc/goals/selected/victoria/migrate-ci-cd-jobs-to-ubuntu-focal.h>

Change-Id: Id6b499239fa8b6480c5f67d460215ab458677c6d
2020-09-10 00:46:55 +00:00
Zuul
32943fd5a5 Merge "Add a ping endpoint to RPC dispatcher" 2020-08-28 19:55:30 +00:00
Hervé Beraud
add5ab4ece Run rabbitmq heartbeat in python thread by default
Removing the experimental nature of this feature and activating it by default.
Now to run heartbeat in a green thread users should set this option to False.

Also deprecating this option to prepare future removal and force to always run
heartbeat in a python thread whatever the context.

Change-Id: I32a6c4ad0a456282ec02b5e4c8309489b3c17553
2020-08-27 12:22:41 +02:00
Arnaud Morin
82492442f3 Add a ping endpoint to RPC dispatcher
The purpose of this patch is to add an endpoint directly in RPC
dispatcher, so this endpoint will always be available, in a cross
project manner, without the need for projects to manage it by themself.

This endpoint stay disabled by default, so this change is harmless
without a specific configuration option.

To enable this ping endpoint, an operator will just have to add a new
parameter in the [DEFAULT] section, alongside with rpc_response_timeout
[DEFAULT]
rpc_ping_enabled=true  # default is false

The purpose of this new endpoint is to help operators do a RPC call (a
ping) toward a specific RPC callback (e.g. a nova-compute, or a
neutron-agent).
This is helping a lot for monitoring agents (for example, if agents are
deployed in a kubernetes pod).

The endpoint is named oslo_rpc_server_ping.

Change-Id: I51cf67e060f240e6eb82260e70a057fe599f9063
Signed-off-by: Arnaud Morin <arnaud.morin@corp.ovh.com>
2020-08-18 15:09:29 +02:00
Zuul
8d78ab2339 Merge "Cancel consumer if queue down" 2020-08-01 01:21:42 +00:00
shenjiatong
196fa877a9 Cancel consumer if queue down
Previously, we have switched to use default exchanges
to avoid excessive amounts of exchange not found messages.
But it does not actually solve the problem because
reply_* queue is already gone and agent will not receive callbacks.

after some debugging, I found under some circumstances
seems rabbitmq consumer does not receive basic cancel
signal when queue is already gone. This might due to
rabbitmq try to restart consumer when queue is down
(for example when split brain). In such cases,
it might be better to fail early.

by reading the code, seems like x-cancel-on-ha-failover
is not dedicated to mirror queues only, https://github.com/rabbitmq/rabbitmq-server/blob/master/src/rabbit_channel.erl#L1894,
https://github.com/rabbitmq/rabbitmq-server/blob/master/src/rabbit_channel.erl#L1926.

By failing early, in my own test setup,
I could solve a certain case of exchange not found problem.

Change-Id: I2ae53340783e4044dab58035bc0992dc08145b53
Related-bug: #1789177
2020-07-31 06:05:16 +08:00
Zuul
599c0b9d1f Merge "Bump bandit version" 2020-07-28 16:25:34 +00:00
Zuul
7ef75b44e9 Merge "Catch ConnectionForced Exception" 2020-07-28 16:25:33 +00:00
Moisés Guimarães de Medeiros
6659cb8d19 Bump bandit version
This patch bumps bandit allowed version to >=1.6.0,<1.7.0 in order to
avoid the errors detailed here https://github.com/PyCQA/bandit/pull/393

Change-Id: I9235560667f664643007b8ca0be1707eab4126ad
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-07-25 11:47:53 +02:00
Kenneth Giusti
a5ae9f4aa0 Move legacy grenade jobs to Zuul v3
Also deletes obsolete playbook files for telemetry tests that have
been removed.

Change-Id: Ibbb811e988cc048e6c39a0c2336c716a1a0ddb30
2020-07-20 09:51:15 -04:00