Commit Graph

147 Commits

Author SHA1 Message Date
Takashi Kajinami 6c7020c51a Drop remaining references to eventlet options
Because these were removed by [1]. Also update the previous release
note to document the upgrade impact on catalog information (like
endpoint urls) including string interpolations requiring these removed
options.

[1] 2a3c73c49b

Change-Id: If78d0b93665410b86754ea35653ca9d4c15c81c5
2024-01-27 21:02:14 +09:00
Stephen Finucane 8c9462f6fa db: Remove legacy migrations
sqlalchemy-migrate does not (and will not) support sqlalchemy 2.0. We
need to drop these migrations to ensure we can upgrade our sqlalchemy
version.

Change-Id: I31ba9e4f129a7cc28744e814b5fd28eb284ae3de
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2023-02-28 17:26:39 +00:00
Stephen Finucane aebd037f50 sql: Move migrations to 'legacy_migrations'
We're going to add new alembic-based migrations shortly. These will live
in the 'keystone.common.sql.migrations' module. Prepare for this by
moving the existing migrations from ''keystone.common.sql' into a common
'keystone.common.sql.legacy_migrations' module.

Change-Id: I5ab7b010b21268977f73738e895bbd21442e9455
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-01-21 13:39:30 +00:00
Stephen Finucane 837a55c3b5 Add generate schemas tool
This is a variant of a tool added to nova during their migration to
alembic. It will be helpful as we continue expanding the repo.

Change-Id: Ib27532005c0f297b2b328cccd8d9528731ec1179
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2022-01-11 12:21:50 +00:00
Vishakha Agarwal b54839f382 Fix user creation with GRANT in MySQL 8.0(Ubuntu Focal)
In Ubuntu Bionic (18.04) mysql 5.7 version used to create
the user implicitly when using using the GRANT.

Ubuntu Focal (20.04) has mysql 8.0 and with mysql 8.0 there
is no implicit user creation with GRANT. We need to
create the user first before using GRANT command.

This patch updates tools/test-setup.sh so that keystone supports
ubuntu focal.

Story: #2007865
Task: #40190

Change-Id: I86d10729cfc7c02f12df611b56f6e263969dfe4b
Closes-Bug: #1885825
2020-08-17 13:37:48 +05:30
Colleen Murphy e2d83ae95d Re-enable line-length linter
In 09088690 we mistakenly added E501 to the flake8 ignore list. Since
then, many new violations have been introduced. This patch re-enables
the check and corrects all violations, except in some cases like unit
test names where the subunit output would suffer if we attempted to
shorten the function name.

This may appear to be a pointless no-op that messes with
git-blameability, and it is, but the reason to do this is that if PEP8
violations are introduced in master and then backported to a stable
branch, most stable branches will fail the pep8 job since the flake8
ignore list is correct for those branches. Rather than loosening the
check in older branches or requiring those backports to fix the linter
errors independently of what's been merged in master, we should fix it
now so that we don't introduce more errors in the future and patches can
more easily be backported.

Change-Id: I9f71926105eb448bb0200201d1838b67d4963cd6
2019-10-21 08:48:47 -07:00
Vishakha Agarwal 1925aa9c24 Fix E731 flake8
This patch fixes E731 for flake8/pep8 which recommends preferring
functions over lambda expressions.

Change-Id: Ied905e1d55ae73b8d390240d3320a8ba0dcca17c
2019-06-19 17:40:01 +05:30
Colleen Murphy 231f6ae18a Add flake8 ignore list to fast8 script
Without this patch, the fast8 tox environment runs flake8 differently
than the pep8 environment does, excluding the ignore list. This patch
ensures they have the same ignore list so that results are consistent.

Change-Id: I3f573e9627b17896fdd57261b9de692d49857140
2019-06-05 14:38:58 -07:00
Vishakha Agarwal e054b368dc Pep8 environment to run on delta code only
Currently tox -epep8 will run flake8 on whole code.
To make this fast, flake8 support is added for only
updated(delta) code. Same can be run by "tox -efast8".

It also determines how many commits to check based on the
$FAST8_NUM_COMMITS env variable. If set to "smart",
it uses git to try to run against all unsubmitted commits.
This allows fast8 to be more useful when actively
developing a series of patches.

Closes-Bug: #1829455
Change-Id: Ic02d7a91c6f6b227abf14bc6f7cb85815591c0d3
2019-05-21 10:38:51 +05:30
Sreyansh Jain 666f33a55a changed port in tools/sample_data.sh
With the removal of the Identity v2 API, keystone now runs on
port 5000, rather than on the port 35357 which was used earlier.

Change-Id: I5a763fbf765553b00713add9f863751b418deb82
2018-11-15 20:45:59 +05:30
Colleen Murphy 45e8b6e0ec Increase MySQL max_connections for unit tests
We've seen that sometimes our unit tests create a lot of mysql
connections simultaneously[1][2] and cause the tests to fail. Increase
the max_connections limit from 151 to 1024, which is what devstack
uses[3].

[1] http://logs.openstack.org/43/536543/9/check/openstack-tox-py35/0729ea7/job-output.txt.gz#_2018-01-30_19_36_38_136523
[2] http://logs.openstack.org/23/524423/44/gate/openstack-tox-py35/0f8083f/job-output.txt.gz#_2018-01-28_21_11_52_855308
[3] http://git.openstack.org/cgit/openstack-dev/devstack/tree/lib/databases/mysql?id=640150683d137a9a10dfe833e7a34b7ea6cdfb1a#n99

Change-Id: Ic9f9ca696af1876eb5a728356a98d70352ef9bc3
Related-bug: #1746016
2018-01-30 23:49:04 +01:00
wangxiyuan 098279129b Refresh sample_data.sh
This patch refresh the sample_data.sh file to satisfy the newest
OpenStack.
It includes:
1. Remove ec2 which has been removed from Nova already.
2. Remove Cinder V1 which has been removed as well.
3. Add the missing cinder user.
4. Add nova v2.1, cinder v2 and v3 support.
5. Change tenant_id to project_id

Change-Id: I792dfcd058c169c69a8ed82d04aafc8d53649087
2017-12-11 15:25:14 +08:00
Luigi Toscano d9f896d430 Use ostestr instead of the custom pretty_tox.sh
Switch to os-testr as wrapper for testr, instead of the custom
script pretty_tox.sh.

Change-Id: If10ac96ac32813714be2b83f895071820126dbd8
2017-02-09 16:03:59 +01:00
Andreas Jaeger 6603d40e0b Prepare for using standard python tests
Add simple script to setup mysql and postgresql databases, this script
can be run by users during testing and will be run by CI systems for
specific setup before running unit tests.

This allows to change in project-config the python-db jobs to
python-jobs since python-jobs will call this script initially.

Update README for this.

See also
http://lists.openstack.org/pipermail/openstack-dev/2016-November/107784.html

Needed-By: Ic42f8d5392ab1d9b52c6c84c92dee0092bd2779a
Change-Id: I253726467151622e8aa3ff40bacc0b3f9903b342
2017-02-02 12:13:12 +00:00
Dougal Matthews f12f83ba9a Correct missspellings of secret
Change-Id: Ib60746ddd19cdf5f9a65498a9a627a321fdad2c7
2016-12-08 13:25:05 +00:00
Chetna Khullar 5fe929d450 Corrects sample-data incorrect credential call
This bug-fix corrects the sample-data credential call.

Change-Id: I216b455cf3d9966a2b641a79132e2f3dfdae5920
Closes-Bug: 1647486
2016-12-06 05:31:39 +00:00
Morgan Fainberg 94391a3240 Remove helper script for py34
Remove the helper script for py34, it prevents the use of arguments
being passed down e.g. tox -epy34 -- --failing due to the lack of
passing {posargs} to the script. Since py34 has no special exceptions
now, the specific env for py34 with a special pretty_tox script is
not needed.

Change-Id: I4d960d82e2844c0c82a14be5e92230f1698e11b3
2016-05-21 23:46:58 +00:00
Sean Perry ee0a294ec3 Py3 oauth tests
Remove the last exclusion. Revert py3 tests to use same case as
py2 tests.

Change-Id: I651a7163ac8a20258e55d8a118245d658a5af3ed
2016-05-20 11:59:15 -07:00
Jenkins 1bd43985e9 Merge "Add `patch_cover` to keystone" 2016-03-29 06:13:41 +00:00
Tom Cocozzello 9a92c471e4 Add `patch_cover` to keystone
`patch_cover` checks to make sure your patch has
adequate test coverage.

How it works is it stashes your changes, runs `tox -e cover`,
saves the results then stash pops your change and runs cover
again.  It then reports to show if your code in your patch
has 100% test coverage or not.

The intent of this job is to be a non-voting / warning like
job that can inform reviewers if the review clearly needs
more testing.

Since cover.sh is copied from [0] the copyright should
reflect the owners of the code.

[0]: https://github.com/openstack/rally/blob/master/tests/ci/cover.sh

Change-Id: I66572072aa4d9563b6e1f73a8f8b3437116ef3c4
2016-03-28 21:26:01 +00:00
Colleen Murphy f7983d4bdf Update dev docs and sample script for v3/bootstrap
The default value for the admin_token parameter was removed from the
sample config file in ea952bd2, so the recommendation in the developer
documentation to use it without first setting it will result in an
error. This patch updates the developer documentation and the
sample_data.sh script to use the Identity v3 API and to follow the
latest recommendations for bootstrapping an admin user with which to
insert sample data.

Change-Id: I424ff6129d4ddcd63fb2bed4eabcbe910ab0153e
2016-03-17 15:11:37 -07:00
David Stanek 8f15724dc7 Stop using nose as a Python3 test runner
There are several reasons for this change:
- removes the need for the custome py3 test dependencies
- makes the broken tests more visible because they are listed
  instead of the working ones
- using a blacklist means that new test files are tested by default in
  py3

bp python3

Change-Id: I7472eec05d80cdd99c0ee376159578e0d7306f51
2016-02-11 06:40:24 +00:00
Jenkins 6a4926b863 Merge "Do not assign admin to service users" 2016-02-04 03:50:44 +00:00
Jenkins 75ccdb2599 Merge "Create neutron service in sample_data.sh" 2016-02-04 03:50:28 +00:00
Samuel de Medeiros Queiroz 9d52fb6352 Do not assign admin to service users
As pointed out by Brant Knudson in change [1], the sample policy file
allows the service user to validate tokens [2], so service users don't
need 'admin' role, they only need 'service'.

This patch adds the 'service' role creation to our tools/sample_data.sh
and updates service roles to it rather than 'admin'.

[1] Iebc4f6b005e0466fe60691d964c7dea0e0eee947
[2] http://git.openstack.org/cgit/openstack/keystone/tree/etc/policy.json#n94

Change-Id: I3336514f7a2e1e749908d92b693d765c3ed48f51
2016-02-02 14:27:55 -03:00
Ghe Rivero 19f3ad9eca Create neutron service in sample_data.sh
With the addition of Neutron to the sample_data.sh script, all services
required by the compute starter kit tag [1] are created (plus swift and ec2
compatible credentials)

[1] http://governance.openstack.org/reference/tags/compute_starter_kit.html

Change-Id: Iebc4f6b005e0466fe60691d964c7dea0e0eee947
2015-12-10 16:13:02 +01:00
Jenkins 693755ee25 Merge "Remove all traces of oslo incubator" 2015-08-25 07:32:45 +00:00
David Stanek 55e9514cbd Remove all traces of oslo incubator
- removes run_tests.sh since it's rarely used and an alternative exists
- removes all the remaining incubator files since nothing uses them

The real value of run_tests.sh over tox is that run_tests.sh enables
running tests against against any virtualenv or Python installation. tox
is just a tool that runs testr commands in a specific virtualenv. testr
can be used directly as a run_tests.sh replacement for running tests in
an arbitrary virtualenv or against any Python installation.

blueprint remove-oslo-incubator
Change-Id: I9d4ef8bf935eb565af1c8d53d1ed71be9a94a975
2015-08-20 20:16:42 +00:00
Qiaowei Ren feb98a83b9 Add necessary executable permission
tools/pretty_tox.sh should be marked as executable, this patch
just 'chmod +x' to it.

Closes-Bug: 1486313
Change-Id: Ia5fa921e83da1e094970b1e44c9709272c7e32d3
2015-08-19 10:57:34 +08:00
Ghe Rivero 6cd2e5eccd Missing ADMIN_USER in sample_data.sh
When moving from keystone to openstack client, the initialization of
the ADMIN_USER variable was removed, making the script to fail.

Change-Id: Iee2d5b1cbed6c93e335a4b4dbad3034a2f8e29ed
2015-08-01 05:16:28 +02:00
Ghe Rivero e614b29940 Update exported variables for openstack client
When using openstack client to populate an initial keystone
deployment, instead of the former keystone client, the env.
variables needed are OS_TOKEN and OS_URL instead of the
previous OS_SERVICE_TOKEN and OS_SERVICE_ENDPOINT

Change-Id: I79dcd56896945267cf1c8ff4378ffff63048e155
2015-08-01 05:11:07 +02:00
Eric Brown 82449dd550 Replace reference of ksc with osc
The leading comment in sample_data.sh still references the old
python-keystoneclient when its python-openstackclient that is
used to populate sample data.

This patch also makes a minor fix of the Swift service description.

TrivialFix

Change-Id: Ie4f5729dcc0b3a6164470d11ba91ddaaec0bb022
2015-07-12 22:47:27 -07:00
Steve Martinelli fb5bdac8e5 Remove convert_to_sqlite.sh
The file has not been modified in 3 years, and seems like a
utility a deployer should maintain for debugging.

Change-Id: Ib4d55052c27facf7d96655c75784b657d1b01975
2015-07-08 03:25:41 +00:00
phil-hopkins-a fa43b6f6d1 updates sample_data script to use the new openstack commands
Cleans up the sample_data script to replace the keystoneclient commands
with the new openstackclient commands

Change-Id: Id68ff2b466e582a0c2f4418d173f7d63c14f5f37
Closes-Bug: #1459816
2015-06-01 11:33:58 -05:00
Brant Knudson 8c76fbe02d Use subunit-trace from tempest-lib
This makes the test output look like nova's, for consistency.

Change-Id: I24887521d5a3c7d768d77e07e40ab4468e77c9b9
2015-02-13 07:45:31 -06:00
Dolph Mathews 083d1cd522 switch from sample_config.sh to oslo-config-generator
This switches keystone to use oslo-config-generator, where the contents
of our sample configuration file are configured using a configuration
file in config-generators/, because the only way to have tox create
files is to have configuration files for your configuration files
(seriously, it chokes when redirects are included in the command for a
test environment).

This also takes advantage of oslo-config-generator's ability to set the
line wrap width, which is done at 79 chars here to match the rest of our
code.

Also update the actual sample file under etc/

Change-Id: I9f9a157c7802c56a2c7484f6f4adec4aeb4071b8
Closes-Bug: 1324610
2015-01-02 15:04:20 -06:00
Guang Yee cdda91986b make sample_data.sh account for the default options in keystone.conf
Closes-Bug: 1394816

Change-Id: Ifb19d09a1ed8e82aebcaea82783480176daa3536
2014-11-20 16:50:55 -08:00
Steve Martinelli ac87550a55 Use oslo_debug_helper and remove our own version
With the latest version of oslotest, we can now take advantage
of a common oslo_debug_helper script.
We can now remove our own homebrewed version, minor changes to
tox.ini were needed.

Change-Id: Ide72fb3531f0498dfe289d028049cd432aa08887
2014-09-05 16:27:39 -04:00
Jenkins bbfd58a6c1 Merge "Do not use keystone's config for nova's port" 2014-07-11 23:36:17 +00:00
Brant Knudson ef2040dae8 Sync with oslo-incubator e9bb0b59
This syncs Keystone with oslo-incubator commit hash
e9bb0b596650540f336afb070a1f8c7de099721f .

In keystone:

 $ rm -r keystone/openstack/common

In oslo-incubator:

 $ git checkout e9bb0b596650540f336afb070a1f8c7de099721f
 $ python update.py ../keystone

Commits
-------
bc48099 Log the function name of looping call
109e325 Use oslo.messaging to publish log errors
de4adbc pep8: fixed multiple violations
9651085 generator: remove unused param, small clean up
eac71f5 Fix common.log.ContextFormatter for Python 3
238e601 Make policy debug logging less verbose
250cd88 Fixed a new pep8 error and a small typo
5e3d3a5 Mask passwords included without quotes at the ends of commands
e7c8a45 Improve error handling for conf sample generation
9e88af1 fixed typos found by RETF rules
5f12bba Implement stop method in ProcessLauncher
0d7296f Add kwargs to jsonutils.load(s) functions
9c88dc3 file_open: fixed docstring to refer to open() instead of file()
d78b633 Fixes a simple spelling mistake
621d831 always log a traceback in the sys.excepthook

Change-Id: I4ef56ce08e1f3bbc0ddb82a495da153e09a14c50
2014-07-06 11:10:11 -05:00
Morgan Fainberg f18911ea14 Do not use keystone's config for nova's port
Keystone's configuration should have no bearing on the catalog
for nova's port. Nova's port is "static" data from the templated
catalog perspective.

The 'compute_port' option has been marked as deprecated and
slated for removal in the L release. The default/sample
templated catalog files do not rely on this option any
longer.

Change-Id: I51b0ec951449360f002c2e7c900ded0f40e16044
Closes-Bug: #1335278
2014-07-01 11:03:59 -07:00
Jenkins db0519dfa0 Merge "Make gen_pki.sh & debug_helper.sh bash8 compliant" 2014-06-23 18:39:44 +00:00
Lance Bragstad 491b29bed8 Make gen_pki.sh & debug_helper.sh bash8 compliant
Now that bash8 is available on PyPI we can use it to clean up the bash
scripts in Keystone. This also uses bash8 in tox. For now we can add
files to the tox check manually as we make them compliant.

Change-Id: I87a7478949114163f0614b1a6d8b249e14afe0df
2014-06-23 15:41:58 +00:00
Ilya Pekelny 8db9ba7906 oslo.db implementation
Use oslo.db library instead of common.db code.

Change-Id: I3019e35bf961b50cbd3d9737ba7c08b3f20536a0
2014-06-20 11:08:21 +03:00
David Stanek f4275c508a Cleanup openstack-common.conf and sync from olso
An upcoming change[1] in oslo's update.py adds new warnings for
style issues in the config. To compensate this commit:

 - orders the modules alphabetically
 - uses the script directive for scripts

Sync with oslo-incubator caed79d

This syncs Keystone with oslo-incubator commit hash
caed79d8239679cb74476bb0d9e5011b4fcc39da.

In keystone:

$ rm -r keystone/openstack/common

In oslo-incubator:

$ python update.py ../keystone

Commits
-------

1173e46 Remove ValueError when accessing sys.modules
17c4e21 Fix docstring indentation in systemd
90ae24b Remove redundant default=None for config options
6c7407b fileutils: port to Python 3
18f2bc1 Enforce unicode json output for jsonutils.load[s]()
af36c2a Fix logging setup for Python 3.4
5ae792b Document config generator variables
ea9ead8 Allow file exclusion in config generator
cdcc19c Mask passwords that are included in commands
9e5a393 jsonutils.load() accepts file pointer, not string
a6b2aec On Python <= 2.6, use simplejson if available
fe3389e Improve help strings
8a0f567 Remove str() from LOG.* and exceptions
f3f14c9 Fixed several typos
0f495ee Emit a log statement when releasing internal lock
9912e5d Add API for creating translation functions

1. https://review.openstack.org/76901

Change-Id: I89de9ae9e3c574095967a2a67e842a90b5527ffa
2014-05-28 16:24:44 +00:00
Brant Knudson ea7018fe5f Sync with oslo-incubator 2fd457b
This syncs Keystone with oslo-incubator commit hash
2fd457bf2ccbeb2b84ffb204778b6417cd5405ba .

In keystone:

 $ rm -r keystone/openstack/common

In oslo-incubator:

 $ python update.py ../keystone

The newer lockutils requires posix_ipc. It's already in
global-requirements.

Keystone uses gettextutils and versionutils from oslo-incubator
so those should be in openstack-common.conf. They were pulled in
as dependencies of other oslo-incubator modules but Keystone
shouldn't rely on that.

Keystone doesn't use log_handler directly so that module was
removed from openstack-common.conf. log_handler is available in
the oslo.messaging library.

Change-Id: I6082f4e0995ca35372f9b061d8f76890aa93250c
2014-04-15 15:14:25 -05:00
Morgan Fainberg 23a4fe9ec7 Update config options with helpstrings and generate sample
Restructure the common config to include many help strings to
support using the oslo.config auto-generated sample config file.

Closes-Bug: #1229941
Change-Id: If352b3b816b1e7dc8b5fc3b9c1cb2adab187ffda
2014-02-20 19:18:49 -08:00
Morgan Fainberg 10f9c1f1c3 Setup code for auto-config sample generation
Sync in the oslo code for auto-config sample generation and
make the appropriate changes to setup to allow for automatic
option discovery.

`test-requirements.txt` now includes stevedore to
ensure the oslo libraries can all be loaded as expected.

Change-Id: Ieca0aea4d3c67b930c12467317d2f4d83763b601
2014-02-16 20:41:00 +00:00
Eric Guo 263b27f2cd Remove vim header
We don't need vim modelines in each source file, it can be set in
user's vimrc.

Change-Id: Ie51ad62946afdf39eadcd59edaf8134ec10265c6
Closes-Bug: #1229324
2014-02-08 23:54:04 +08:00
Brant Knudson c8302509e6 Debug env for tox
Running a test with pdb was difficult because testr captures
output and causes pdb prompt to quit.

Tips for how to run with debug are provided here:
 https://wiki.openstack.org/wiki/Testr#Debugging_.28pdb.29_Tests

This change puts these commands into a debug env in tox.ini so
you can do a command like

 tox -e debug test_v3_trust_token_get_token_fails

or, for more granularity:
 tox -e debug keystone.tests.test_sql_migrate_extensions.EndpointFilterExtension
 tox -e debug keystone.tests.test_sql_migrate_extensions.EndpointFilterExtension.test_downgrade

and when it hits your breakpoint you'll get the debug prompt.

Change-Id: I2b5dc81f4652dc89ecbcc7c785245a81cf77a1ca
2013-12-10 16:37:16 -08:00