Commit Graph

3016 Commits

Author SHA1 Message Date
Zuul 0947762d52 Merge "[DEFAULT] periodic_coordinator_backend_url should be secret" 2023-11-06 04:02:13 +00:00
songwenping 019232f541 Add unit test for check replace hadoop_version with plugin_version
Change-Id: Icdc99967532b3df1b20a32333921b77c98e7dd32
2023-09-21 14:00:30 +08:00
guolimin.lc a806a536b6 Remove redundant "=" to imporve doc format
Change-Id: Ia24a706d93fa0d717978b127d53135e225f05da3
2023-08-09 13:48:53 +08:00
zhouxinyong 99865a7b03 Use new get_rpc_client API from oslo.messaging
Use the new API that is consistent with
the existing API instead of instantiating the client
class directly.

This was introduced in release 14.1.0 here [1] and
added into oslo.messaging here [2]

[1] https://review.opendev.org/c/openstack/requirements/+/869340
[2] https://review.opendev.org/c/openstack/oslo.messaging/+/862419

Change-Id: I7452e9b8b6ed07d89bac7d0c1dc188ad0ed25ffa
2023-05-18 14:07:06 +08:00
Takashi Kajinami d7f0c8b299 [DEFAULT] periodic_coordinator_backend_url should be secret
This option can sometimes contain secrets.

For example when redis coordination backend is used and authentication
is enabled in redis, the plain redis password is put as an URL element.

[DEFAULT]
periodic_coordinator_backend_url=redis://:password@127.0.0.1:6379

Change-Id: I09040b54f6e2ee4f0e71c601400b601b5de19780
2023-03-21 01:46:23 +09:00
Alfredo Moralejo 5e7258bcc8 Fix compatibility with oslo.db 12.1.0
oslo.db 12.1.0 has changed the default value for the 'autocommit'
parameter of 'LegacyEngineFacade' from 'True' to 'False'. This is a
necessary step to ensure compatibility with SQLAlchemy 2.0. However, we
are currently relying on the autocommit behavior and need changes to
explicitly manage sessions. Until that happens, we need to override the
default.

Co-Authored-By: Stephen Finucane <stephenfin@redhat.com>
Change-Id: I5dda36e43caeeb2983cb6a9e0743591fc246d323
2022-12-16 09:40:41 +00:00
Dmitriy Rabotyagov ebc6d74bf8 Make ApiValidator to work with jsonschema>=4.0.0
As of Zed jsonschema version has been bumped to 4.14.0 in
upper-constraints, which means project should support running with
this version. This patch aims to fix ApiValidator that is not compatible
with new jsonschema.

Other deprecations, like FormatChecker.cls_checks decorator are left
intact and must be covered with follow-up patches.

We also move zuul queues to project scope as otherwise jobs do not
run due to config error.

We also replace iteritems with six method as iteritems have been dropped
from Python 3.

Change-Id: Ia8b69587aa9b3d04ffcdea7c6b97a8ae65f67534
2022-12-09 12:29:30 +00:00
Luigi Toscano 2627d3433b tests: Remove use of 'oslo_db.sqlalchemy.test_base'
It has been reported that "the various test cases and mixins
in 'oslo_db.sqlalchemy.test_base' have been deprecated since
oslo.db 4.34.0 (March 2018)." so migrate to a more stable
and supported solution.

Change-Id: I89aff35352406c0895d379ef6548b406572d076d
2022-04-19 12:15:46 +01:00
Luigi Toscano f3fea3abb7 Fix Flask 2.1 compatibility, disable unstable job
Since Flask 2.1, the same blueprint cannot be registered multiple
times with different url_prefix values, unless the 'name' parameter
is set. Otherwise the following error is reported: "The same blueprint
cannot be registered with the same name. Use name= when registering
to specify a unique name."

At the same time, disable the openstack-ansible job,
which started to fail again, but at this point the priority
is to unblock the gates.

Change-Id: I50df2fec3fd312082a14ef2a5b6774a2515afb44
2022-04-15 17:17:48 +02:00
Takashi Kajinami ab73b8f4a7 Remove reference to deprecated RequestContext.user
The user property of oslo_context.context.RequestContext has been
deprecated in favor of the new user_id property. This change replaces
reference to the deprecated user property.

Change-Id: Ib5ca9b82970d217df5133b2498c3577af0e60dd9
2022-03-16 23:25:36 +09:00
Takashi Kajinami d3ba5357c3 Fix compatibility with oslo.context >= 4.0.0
The tenant argument of RequestContext is no longer available since
oslo.context >= 4.0.0 . This change fixes the compatibility issue
caused by that removal.

NOTE:
Because scenario jobs are still broken with this change, these jobs
are made non-voting temporally to unblock the other jobs. Currently
this issue is blocking package build in RDO.

Story: 2009921
Task: 44779
Change-Id: I1bc81b3c13d2c08bc175d0d4f4365de7b4f71cf9
2022-03-16 23:24:28 +09:00
songwenping 4a2f80d724 Remove unicode from code
In python 3, all strings are considered as unicode string.

This patch drops the explicit unicode literal (u'...')
or (u"..") appearances from the unicode strings.

Change-Id: I502bda0881b284d918f4afedba9bb24eb560211f
2021-10-26 11:56:49 +00:00
qiufossen 243a15ba0f Substring matching image's name
When querying the list of registered images, query according to some
characters of the iamge name.

Change-Id: I1c68efbe2583290bc41f7d35197ef108c484d607
2021-10-21 01:16:10 +00:00
Takashi Kajinami 0e20049240 Drop support for Block Storage API v2
... because it was already removed from cinder[1].

Note:
The sahara-openstack-ansible-functional job is made non-voting now
because it doesn't pull code changes. This issue is reported in [2]
and will be addressed separately.

[1] e05b261af7dcd24096b229860df65dff1d385910
[2] https://storyboard.openstack.org/#!/story/2009081

Change-Id: I10261693216ca93faa49d22f2827a939114d234d
2021-07-28 00:12:01 +09:00
ruifaling a0de19e45f health check error about SqlAlchemy
Story: 2008900
Task: 42467

Story: 2007450
Task: 39123
Change-Id: I7b671df0c946a96d7f6688b5452a884186e5c11e
2021-05-19 00:47:20 +00:00
ruifaling 5d2f114b42 delete validation error cluster
Change-Id: I1ec693c17a43c09383fa83556cd3275b75ca90fd
story: 2008898
task: 42465
2021-05-17 01:16:03 +00:00
Ghanshyam Mann 9a69cc52b6 [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to do two things:

1. Change the default value of '[oslo_policy] policy_file''
config option from 'policy.json' to 'policy.yaml' with
upgrade checks.

2. Deprecate the JSON formatted policy file on the project side
via warning in doc and releasenotes.

Also replace policy.json to policy.yaml ref from doc and tests.

[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: Ib2101f13171940857fe81f64dd9798dfe489743a
2021-03-30 04:02:11 +00:00
zhufl b4b666cbbd Fix the isolated exception message
Exception's error message should be put right after the Exception
with a bracket, othersize it will be ignored.

Change-Id: I0be28c20ff21805d9a1a52b702cf497df7b9069e
2020-12-04 15:15:39 +08:00
zhaoleilc 7cdda56b2c Correct some typos in some strings
This patch changes 'begining' to 'beginning'
in some strings

Change-Id: Icd688c42086c45357aacfba681270b2fe9e85ae6
2020-07-23 15:15:13 +08:00
Dirk Mueller 3f004e6a9f Switch from unittest2 compat methods to Python 3.x methods
With the removal of Python 2.x we can remove the unittest2 compat
wrappers and switch to assertCountEqual instead of assertItemsEqual

We have been able to use them since then, because
testtools required unittest2, which still included it. With testtools
removing Python 2.7 support [3][4], we will lose support for
assertItemsEqual, so we should switch to use assertCountEqual.

[1] - https://bugs.python.org/issue17866
[2] - https://hg.python.org/cpython/rev/d9921cb6e3cd
[3] - testing-cabal/testtools#286
[4] - testing-cabal/testtools#277

Change-Id: Ic0d8c9e1025cd05f4042f1c5ba440cc03a0b5834
2020-06-23 14:19:43 +02:00
Hervé Beraud 81bae85a9a Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: Iab3b7c54b1e3830924030ebf25e7b829c7f31ac9
2020-06-02 20:56:50 +02:00
Corey Bryant 9c83e69e70 Monkey patch original current_thread _active
Monkey patch the original current_thread to use the up-to-date _active
global variable. This solution is based on that documented at:
https://github.com/eventlet/eventlet/issues/592

Change-Id: I93ce7f11dcd8c1f01616580b65e5e581b775e8c5
Story: 2007614
2020-05-05 15:52:27 -04:00
Jeremy Freudberg 1fea6624b4 Use flask's builtin methods for test context
In Python 3.8 unittest.mock can't successfully mock Flask.
So we need to use test_request_context instead.

Tests are slightly restructured: assertions are now done on an actual
Response object.

Remove some apparently duplicated lines.

Change-Id: I83f240400295d38fe40d54ab7a8f6442f3981729
Story: 2007596
Task: 39565
2020-04-30 10:37:24 -04:00
OpenStack Proposal Bot f7a36e7252 Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: Ie680f1b1edf9d70e1f88fef3c1e6b3e36d3b44dc
2020-04-26 08:25:03 +00:00
Zuul b41fadaf7e Merge "Update hacking for Python3" 2020-04-23 10:15:47 +00:00
Andreas Jaeger 36d8b35478 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Update local hacking checks for new flake8.

Note: The repo has been using an uncapped requirements, so was testing with
hacking 2.0 which disabled the old way of local testing integration.

Remove S367 and S368 since they are not working under python3
"NOTE(Kezar): This checks a good enough if we have only py2.7 supported.
 As soon as we'll get py3.x we need to drop it or rewrite. You can read more
 about it in dev-list archive, topic: "[hacking]proposed rules drop for 1.0"

Also, hacking now has H304 and H306 which test exactly the same.

Change-Id: I0b21554a5f9a69ed631b18c427b80c082011f774
2020-04-22 15:45:44 +02:00
Sean McGinnis 551f58b978 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: Ic07c0f6fa0b23242eb884cc34ac9d963b3030b17
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-04-22 15:40:48 +02:00
Luigi Toscano c33675508c (Temporarily) skip TestVerifications tests
They are failing thanks to sqlalchemy.orm.exc.DetachedInstanceError:
Parent instance <ClusterVerification at ...> is not bound to a Session;
lazy load operation of attribute 'checks' cannot proceed
(Background on this error at: http://sqlalche.me/e/bhk3)

The issue seems to be difficult to tackle, so let's reevaluate after
cutting Ussuri branches.

Story: 2007450
Task: 39508
Change-Id: If0b47fa815ef778d58542f4c7d84218aef833802
2020-04-21 15:25:19 +02:00
pangliye 69587fd50e Fix misspell word
Change-Id: I53afb0a21e522616798af0e8ad3602f9fc039418
2019-11-19 08:09:36 +08:00
Zuul d39c2678ff Merge "Python 3 fixes" 2019-10-07 20:34:45 +00:00
Telles Nobrega abc8f57055 Python 3 fixes
String to Bytes compatibility.

Story: #2006258
Task: #35875
Change-Id: Id0ad0f3c644af52f41217105b249df78d0b722cc
2019-10-02 08:29:03 -03:00
Luigi Toscano 3e61559192 Fix unit tests: no more cinderclient v1
The most recent version of python-cinderclient dropped the support
for cinderclient v1.
We could bump the minimum cinderclient version, but the Cinder v1
API has been deprecated since Juno, so we can safely ignore it.

Change-Id: I8e90e812882fa1288bc379606a55305c30cd6656
2019-09-20 22:03:35 +02:00
Luigi Toscano cc3a42ef22 Remove a monkey-patching workaround for python < 2.7.3
We moved way past that version.

Change-Id: Ic775e8653520c10d0a87f768db20b06b698b4444
2019-07-22 18:24:47 +02:00
zhufl d17fd1d1ea [Trivial fix]Remove unnecessary slash
This is to remove the unncessary slash when the line doesn't
exceed the length of 79, to make the code more readable.

Change-Id: I2d25d55b6e3e7474d162fe6d2e6b9e325089980b
2019-05-06 17:36:00 +08:00
OpenStack Proposal Bot 74897906ba Imported Translations from Zanata
For more information about this automatic import see:
https://docs.openstack.org/i18n/latest/reviewing-translation-import.html

Change-Id: I9b38471eb374c0caa07ee1a24d25ffe33fa81958
2019-03-22 06:50:07 +00:00
Telles Nobrega dc17f1903f Making Sahara Python 3 compatible
Sahara fails to connect and operate on remote machines
because the output from Subprocess on python 3 are bytes
and that breaks follow up actions.

Change-Id: Id55e6c06d3b6ead18501a0e2146af37bf493881d
2019-03-19 12:53:40 -03:00
zhufl cd68ad367c Add missing ws seperator between words
This is to add missing ws seperator between words in log message.

Change-Id: I7b534424e3c76a65b1ff5cbe82e1ec5427e2322a
2019-03-11 16:46:39 +08:00
Luigi Toscano b95503f38f Use authorize instead of enforce for policies
After fully implementing policies in code, the authorize method
can be safely used and its a safeguard against introducing
policies for some API which are not properly defined in the code.

Change-Id: I499f13c34027b217bf1de905f829f36ef919e3b8
2019-03-08 15:26:58 +01:00
Zuul 193a604839 Merge "Declare APIv2 stable and CURRENT" 2019-03-07 16:04:25 +00:00
Zuul f5e047ec2c Merge "Fixing policies inconsistencies" 2019-03-06 20:01:33 +00:00
Telles Nobrega f422b31b81 Fixing policies inconsistencies
Fixing some jobs/job-templates/job-executions policy inconsistencies.

Change-Id: I05223981bd44d5f467808576113c29fbb37a3191
Story: #2004675
Task: #28666
2019-03-06 13:50:28 -03:00
Zuul 06ded8450d Merge "Adapt to the additional rules from pycodestyle 2.5.0" 2019-03-04 13:52:50 +00:00
Zuul 7a3d3e960b Merge "Make sure that default_ntp_server option is exported" 2019-03-02 02:13:33 +00:00
Luigi Toscano b21e696926 Adapt to the additional rules from pycodestyle 2.5.0
It is wreaking havoc on the openstack gates, let's fix the issues.

Fix:
- E117: Over-indented code blocks;
- E305: Expected 2 blank lines after class or function definition

Ignore for now:
- W504: Line break after binary operator
- W605: Invalid escape sequence

W504 should be fixed together with its sibling W503.

Change-Id: I1483fae77153ffb24bfc51de2b83ea9db6737bfd
2019-02-15 00:18:53 +01:00
Telles Nobrega 8f62975a8a Fixing NTP issues for CDH plugin
First, we are fixing the adding of a new NTP server to ntp.conf.
The way it is currently done the server is added to the end of the
file and we fixed it to add it to the beginning of the config file.
Second, we are changing the order of when we set up ntp and the
service is started, because CDH fails to detect the sync'd time if
it has be synchronized after the start of the service.

Story: #2004981
Task: #29440

Change-Id: Ic2d7697a4036f5f689f065db081d53d4b37532cf
2019-02-13 16:13:48 -03:00
Zuul 2e09de9c82 Merge "Dynamically loading plugins" 2019-02-08 22:07:02 +00:00
Telles Nobrega 21791d1f89 Changing hdfs fs to hdfs dfs
The command hdfs fs has been deprecated in favor of hdfs dfs.

Story: #2004952
Task: #29368
Change-Id: If8db759ab40ca858594498bc5e6f94f416da2545
2019-02-06 08:34:38 -03:00
Telles Nobrega 55bd5da57f Dynamically loading plugins
Since plugins are not part of Sahara core anymore, loading plugins
like we currently do fails when plugins are not installed.
Currently we check the list of loaded plugins by checking the CONF
file plugins session. To fix that, we are changing to check the list
of loaded plugins on the PluginManager variable loaded_plugins, this
way we can instead of failing to start sahara if a desired plugin
is not installed, we can warn that the plugin was not loaded and
continue the application.

Change-Id: Iaae3a75cd75b06e94bc4492e5dc654a6281fdff4
2019-02-05 11:30:09 -03:00
zhufl 7f8c565ddd Add missing ws separator between words
This is to add missing ws separator between words.

Change-Id: If25f019a123ff2a56c8c6709a9f87ecfc4037996
2019-01-28 14:00:01 +08:00
Luigi Toscano e51dd01096 Make sure that default_ntp_server option is exported
After this change, like all other configuration options,
it is written down by oslo-config-generator.

Story: 2004848
Task: 29060
Change-Id: Idf06726160ad789fe097a91eab315949bcae0059
2019-01-24 18:59:38 +01:00