[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#1885825
Fix user creation with GRANT in MySQL 8.0(Ubuntu Focal)
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.

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

- bug#1886296
pyflake issue and some pep8 fixes.

Story: #2007865
Task: #40209

Related-Bug: #1885825
Related-Bug: #1886298

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

Change-Id: Iac9652b0d36ef208075da506957cc87f22912c45
This commit is contained in:
Ghanshyam Mann 2020-08-01 19:39:52 -05:00
parent 4b95c078cc
commit 0a1d21ff47
6 changed files with 20 additions and 15 deletions

View File

@ -25,7 +25,7 @@ keystoneauth1==3.9.0
keystonemiddleware==4.18.0 keystonemiddleware==4.18.0
linecache2==1.0.0 linecache2==1.0.0
Mako==1.0.7 Mako==1.0.7
MarkupSafe==1.0 MarkupSafe==1.1.1
mccabe==0.2.1 mccabe==0.2.1
microversion-parse==0.2.1 microversion-parse==0.2.1
mock==2.0.0 mock==2.0.0
@ -56,11 +56,11 @@ pep8==1.5.7
pluggy==0.6.0 pluggy==0.6.0
ply==3.11 ply==3.11
prettytable==0.7.1 prettytable==0.7.1
psycopg2==2.7 psycopg2==2.8
py==1.5.2 py==1.5.2
pycadf==2.7.0 pycadf==2.7.0
pyflakes==0.8.1 pyflakes==2.1.1
PyMySQL==0.7.6 PyMySQL==0.8.0
pyparsing==2.2.0 pyparsing==2.2.0
pytest==3.4.2 pytest==3.4.2
python-dateutil==2.5.3 python-dateutil==2.5.3
@ -69,7 +69,7 @@ python-keystoneclient==3.15.0
python-mimeparse==1.6.0 python-mimeparse==1.6.0
python-subunit==1.2.0 python-subunit==1.2.0
pytz==2018.3 pytz==2018.3
PyYAML==3.12 PyYAML==3.13
repoze.lru==0.7 repoze.lru==0.7
requests==2.14.2 requests==2.14.2
requestsexceptions==1.4.0 requestsexceptions==1.4.0

View File

@ -207,7 +207,7 @@ class PlacementHandler(object):
raise webob.exc.HTTPBadRequest( raise webob.exc.HTTPBadRequest(
'content-type header required when content-length > 0', 'content-type header required when content-length > 0',
json_formatter=util.json_error_formatter) json_formatter=util.json_error_formatter)
except ValueError as exc: except ValueError:
raise webob.exc.HTTPBadRequest( raise webob.exc.HTTPBadRequest(
'content-length header must be an integer', 'content-length header must be an integer',
json_formatter=util.json_error_formatter) json_formatter=util.json_error_formatter)

View File

@ -471,28 +471,28 @@ def set_allocations_for_consumer(req):
@wsgi_wrapper.PlacementWsgify # noqa @wsgi_wrapper.PlacementWsgify # noqa
@microversion.version_handler('1.8', '1.11') @microversion.version_handler('1.8', '1.11')
@util.require_content('application/json') @util.require_content('application/json')
def set_allocations_for_consumer(req): def set_allocations_for_consumer(req): # noqa
return _set_allocations_for_consumer(req, schema.ALLOCATION_SCHEMA_V1_8) return _set_allocations_for_consumer(req, schema.ALLOCATION_SCHEMA_V1_8)
@wsgi_wrapper.PlacementWsgify # noqa @wsgi_wrapper.PlacementWsgify # noqa
@microversion.version_handler('1.12', '1.27') @microversion.version_handler('1.12', '1.27')
@util.require_content('application/json') @util.require_content('application/json')
def set_allocations_for_consumer(req): def set_allocations_for_consumer(req): # noqa
return _set_allocations_for_consumer(req, schema.ALLOCATION_SCHEMA_V1_12) return _set_allocations_for_consumer(req, schema.ALLOCATION_SCHEMA_V1_12)
@wsgi_wrapper.PlacementWsgify # noqa @wsgi_wrapper.PlacementWsgify # noqa
@microversion.version_handler('1.28', '1.33') @microversion.version_handler('1.28', '1.33')
@util.require_content('application/json') @util.require_content('application/json')
def set_allocations_for_consumer(req): def set_allocations_for_consumer(req): # noqa
return _set_allocations_for_consumer(req, schema.ALLOCATION_SCHEMA_V1_28) return _set_allocations_for_consumer(req, schema.ALLOCATION_SCHEMA_V1_28)
@wsgi_wrapper.PlacementWsgify # noqa @wsgi_wrapper.PlacementWsgify # noqa
@microversion.version_handler('1.34') @microversion.version_handler('1.34')
@util.require_content('application/json') @util.require_content('application/json')
def set_allocations_for_consumer(req): def set_allocations_for_consumer(req): # noqa
return _set_allocations_for_consumer(req, schema.ALLOCATION_SCHEMA_V1_34) return _set_allocations_for_consumer(req, schema.ALLOCATION_SCHEMA_V1_34)

View File

@ -206,7 +206,7 @@ def update_resource_class(req):
@wsgi_wrapper.PlacementWsgify # noqa @wsgi_wrapper.PlacementWsgify # noqa
@microversion.version_handler('1.7') @microversion.version_handler('1.7')
def update_resource_class(req): def update_resource_class(req): # noqa
"""PUT to create or validate the existence of single resource class. """PUT to create or validate the existence of single resource class.
On a successful create return 201. Return 204 if the class already On a successful create return 201. Return 204 if the class already

View File

@ -3,14 +3,19 @@
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
# remove this pyflakes from here once you bump the
# hacking to 3.2.0 or above. hacking 3.2.0 takes
# care of pyflakes version compatibilty.
pyflakes>=2.1.1
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD
# NOTE(tetsuro): Local testing on osx may have problems to install packages, # NOTE(tetsuro): Local testing on osx may have problems to install packages,
# psycopg2 and PYMySQL. You can workaround them using sys_platform qualifier. # psycopg2 and PYMySQL. You can workaround them using sys_platform qualifier.
# See the https://review.opendev.org/#/c/671249/ for details. However, we # See the https://review.opendev.org/#/c/671249/ for details. However, we
# don't use it here to keep the consistency with global requirements. # don't use it here to keep the consistency with global requirements.
psycopg2>=2.7 # LGPL/ZPL psycopg2>=2.8 # LGPL/ZPL
PyMySQL>=0.7.6 # MIT License PyMySQL>=0.8.0 # MIT License
oslotest>=3.4.0 # Apache-2.0 oslotest>=3.4.0 # Apache-2.0
stestr>=1.0.0 # Apache-2.0 stestr>=1.0.0 # Apache-2.0
testtools>=2.2.0 # MIT testtools>=2.2.0 # MIT

View File

@ -23,8 +23,8 @@ sudo -H mysqladmin -u root password $DB_ROOT_PW
sudo -H mysql -u root -p$DB_ROOT_PW -h localhost -e " sudo -H mysql -u root -p$DB_ROOT_PW -h localhost -e "
DELETE FROM mysql.user WHERE User=''; DELETE FROM mysql.user WHERE User='';
FLUSH PRIVILEGES; FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* CREATE USER '$DB_USER'@'%' IDENTIFIED BY '$DB_PW';
TO '$DB_USER'@'%' identified by '$DB_PW' WITH GRANT OPTION;" GRANT ALL PRIVILEGES ON *.* TO '$DB_USER'@'%' WITH GRANT OPTION;"
# Now create our database. # Now create our database.
mysql -u $DB_USER -p$DB_PW -h 127.0.0.1 -e " mysql -u $DB_USER -p$DB_PW -h 127.0.0.1 -e "