From b7b8fcd51eb09656c39ecac2bb0ea8df7a003e4e Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Tue, 15 Sep 2020 02:24:56 +0000 Subject: [PATCH] Several fixes to unblock the gate * Make test-setup.sh compatible with mysql8. Starting from mysql version 8 it's not possible to create a user implictly when using GRANT. * Fix lower constraint for python3.8. See: https://bugs.launchpad.net/nova/+bug/1886298 * Fix pep8 failure Change-Id: I46a8c67a4d5ff97d03db097c17864061befe501c --- lower-constraints.txt | 34 ++++++++++----------- requirements.txt | 14 ++++----- test-requirements.txt | 2 +- tools/test-setup.sh | 4 +-- zun/api/controllers/v1/capsules.py | 6 ++-- zun/api/controllers/v1/containers.py | 14 ++++----- zun/tests/unit/api/controllers/test_base.py | 8 ++--- 7 files changed, 41 insertions(+), 41 deletions(-) diff --git a/lower-constraints.txt b/lower-constraints.txt index c5e3ccdf1..a21832cb2 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -1,6 +1,6 @@ alabaster==0.7.10 alembic==0.9.8 -amqp==2.2.2 +amqp==2.5.0 appdirs==1.4.3 asn1crypto==0.24.0 Babel==2.5.3 @@ -9,7 +9,7 @@ bcrypt==3.1.4 beautifulsoup4==4.6.0 cachetools==2.0.1 certifi==2018.1.18 -cffi==1.11.5 +cffi==1.14.0 chardet==3.0.4 cliff==2.11.0 cmd2==0.8.1 @@ -28,7 +28,7 @@ docutils==0.14 dogpile.cache==0.6.5 dulwich==0.19.0 enum-compat==0.0.2 -eventlet==0.18.2 +eventlet==0.22.0 extras==1.0.0 fasteners==0.14.1 fixtures==3.0.0 @@ -37,8 +37,8 @@ futurist==1.6.0 Flask==0.12.3 gitdb2==2.0.3 GitPython==2.1.8 -greenlet==0.4.13 -grpcio==1.12.0 +greenlet==0.4.15 +grpcio==1.25.0 idna==2.6 imagesize==1.0.0 iso8601==0.1.12 @@ -49,32 +49,32 @@ jsonschema==2.6.0 keystoneauth1==3.4.0 keystonemiddleware==4.18.0 kuryr-lib==0.5.0 -kombu==4.1.0 +kombu==4.6.1 linecache2==1.0.0 logutils==0.3.5 Mako==1.0.7 -MarkupSafe==1.0 +MarkupSafe==1.1.1 monotonic==1.4 msgpack==0.5.6 munch==2.2.0 netifaces==0.10.6 neutron-lib==1.13.0 -numpy==1.14.2 +numpy==1.19.0 openstacksdk==0.12.0 os-api-ref==1.4.0 -os-brick==2.2.0 +os-brick==3.1.0 os-client-config==1.29.0 os-resource-classes==0.1.0 os-service-types==1.2.0 os-traits==0.15.0 os-vif==1.15.1 -os-win==4.0.0 +os-win==4.2.0 osc-lib==1.10.0 oslo.cache==1.29.0 oslo.concurrency==3.26.0 oslo.config==5.2.0 -oslo.context==2.19.2 -oslo.db==4.27.0 +oslo.context==2.22.0 +oslo.db==4.44.0 oslo.i18n==3.15.3 oslo.log==3.36.0 oslo.messaging==5.29.0 @@ -90,7 +90,7 @@ oslo.rootwrap==5.8.0 oslotest==3.2.0 osprofiler==1.4.0 packaging==17.1 -paramiko==2.4.1 +paramiko==2.7.1 Paste==2.0.3 PasteDeploy==1.5.2 pbr==2.0.0 @@ -123,7 +123,7 @@ python-neutronclient==6.7.0 python-subunit==1.2.0 python-zunclient==3.5.0 pytz==2018.3 -PyYAML==3.12 +PyYAML==3.13 repoze.lru==0.7 requests==2.18.4 requestsexceptions==1.4.0 @@ -139,11 +139,11 @@ SQLAlchemy==1.0.10 sqlalchemy-migrate==0.11.0 sqlparse==0.2.4 statsd==3.2.2 -stestr==1.0.0 +stestr==2.0.0 stevedore==1.20.0 tempest==17.1.0 Tempita==0.5.2 -tenacity==4.9.0 +tenacity==6.0.0 testrepository==0.0.20 testresources==2.0.0 testscenarios==0.4 @@ -154,7 +154,7 @@ urllib3==1.22 vine==1.1.4 voluptuous==0.11.1 waitress==1.1.0 -warlock==1.3.0 +warlock==1.3.1 WebOb==1.7.4 websocket-client==0.44.0 websockify==0.8.0 diff --git a/requirements.txt b/requirements.txt index 432c9d8b3..29a72028a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,9 +5,9 @@ cotyledon>=1.5.0 # Apache-2.0 Flask>=0.12.3 # BSD futurist>=1.6.0 # Apache-2.0 -grpcio>=1.12.0 # Apache-2.0 -PyYAML>=3.12 # MIT -eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT +grpcio>=1.25.0 # Apache-2.0 +PyYAML>=3.13 # MIT +eventlet>=0.22.0 # MIT keystonemiddleware>=4.18.0 # Apache-2.0 kuryr-lib>=0.5.0 # Apache-2.0 pecan!=1.0.2,!=1.0.3,!=1.0.4,!=1.2,>=1.0.0 # BSD @@ -27,12 +27,12 @@ oslo.privsep>=1.32.0 # Apache-2.0 oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0 oslo.service!=1.28.1,>=1.24.0 # Apache-2.0 oslo.versionedobjects>=1.35.0 # Apache-2.0 -oslo.context>=2.19.2 # Apache-2.0 +oslo.context>=2.22.0 # Apache-2.0 oslo.utils>=3.37.0 # Apache-2.0 -oslo.db>=4.27.0 # Apache-2.0 +oslo.db>=4.44.0 # Apache-2.0 oslo.rootwrap>=5.8.0 # Apache-2.0 oslo.upgradecheck>=0.1.0 # Apache-2.0 -os-brick>=2.2.0 # Apache-2.0 +os-brick>=3.1.0 # Apache-2.0 os-resource-classes>=0.1.0 # Apache-2.0 os-traits>=0.15.0 # Apache-2.0 os-vif>=1.15.1 # Apache-2.0 @@ -42,6 +42,6 @@ docker>=2.4.2 # Apache-2.0 neutron-lib>=1.13.0 # Apache-2.0 pyroute2>=0.5.7;sys_platform!='win32' # Apache-2.0 (+ dual licensed GPL2) retrying>=1.3.3 # Apache-2.0 -tenacity>=4.9.0 # Apache-2.0 +tenacity>=6.0.0 # Apache-2.0 websockify>=0.8.0 # LGPLv3 websocket-client>=0.44.0 # LGPLv2+ diff --git a/test-requirements.txt b/test-requirements.txt index 5887ad65e..0eea9519c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -16,6 +16,6 @@ tempest>=17.1.0 # Apache-2.0 testresources>=2.0.0 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD testtools>=2.2.0 # MIT -stestr>=1.0.0 # Apache-2.0 +stestr>=2.0.0 # Apache-2.0 Pygments>=2.2.0 # BSD license python-zunclient>=3.5.0 # Apache-2.0 diff --git a/tools/test-setup.sh b/tools/test-setup.sh index e703ff609..4b38910b6 100755 --- a/tools/test-setup.sh +++ b/tools/test-setup.sh @@ -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 " DELETE FROM mysql.user WHERE User=''; FLUSH PRIVILEGES; - GRANT ALL PRIVILEGES ON *.* - TO '$DB_USER'@'%' identified by '$DB_PW' WITH GRANT OPTION;" + CREATE USER '$DB_USER'@'%' IDENTIFIED BY '$DB_PW'; + GRANT ALL PRIVILEGES ON *.* TO '$DB_USER'@'%' WITH GRANT OPTION;" # Now create our database. mysql -u $DB_USER -p$DB_PW -h 127.0.0.1 -e " diff --git a/zun/api/controllers/v1/capsules.py b/zun/api/controllers/v1/capsules.py index b306ee189..1b4d3ea52 100644 --- a/zun/api/controllers/v1/capsules.py +++ b/zun/api/controllers/v1/capsules.py @@ -122,7 +122,7 @@ class CapsuleController(base.Controller): @base.Controller.api_version("1.32") # noqa @pecan.expose('json') @exception.wrap_pecan_controller_exception - def get_all(self, **kwargs): + def get_all(self, **kwargs): # noqa '''Retrieve a list of capsules.''' return self._do_get_all(**kwargs) @@ -172,7 +172,7 @@ class CapsuleController(base.Controller): @api_utils.enforce_content_types(['application/json']) @exception.wrap_pecan_controller_exception @validation.validated(schema.capsule_create) - def post(self, **capsule_dict): + def post(self, **capsule_dict): # noqa """Create a new capsule. :param capsule_dict: a capsule within the request body. @@ -364,7 +364,7 @@ class CapsuleController(base.Controller): @base.Controller.api_version("1.32") # noqa @pecan.expose('json') @exception.wrap_pecan_controller_exception - def get_one(self, capsule_ident): + def get_one(self, capsule_ident): # noqa """Retrieve information about the given capsule. :param capsule_ident: UUID or name of a capsule. diff --git a/zun/api/controllers/v1/containers.py b/zun/api/controllers/v1/containers.py index e0ddbf31f..382a2496d 100644 --- a/zun/api/controllers/v1/containers.py +++ b/zun/api/controllers/v1/containers.py @@ -269,7 +269,7 @@ class ContainersController(base.Controller): @exception.wrap_pecan_controller_exception @validation.validate_query_param(pecan.request, schema.query_param_create) @validation.validated(schema.container_create) - def post(self, run=False, **container_dict): + def post(self, run=False, **container_dict): # noqa interactive = container_dict.get('interactive') if interactive is not None: container_dict['tty'] = interactive @@ -281,7 +281,7 @@ class ContainersController(base.Controller): @exception.wrap_pecan_controller_exception @validation.validate_query_param(pecan.request, schema.query_param_create) @validation.validated(schema.container_create) - def post(self, run=False, **container_dict): + def post(self, run=False, **container_dict): # noqa return self._do_post(run, **container_dict) @base.Controller.api_version("1.39", "1.39") # noqa @@ -290,7 +290,7 @@ class ContainersController(base.Controller): @exception.wrap_pecan_controller_exception @validation.validate_query_param(pecan.request, schema.query_param_create) @validation.validated(schema.container_create_v139) - def post(self, run=False, **container_dict): + def post(self, run=False, **container_dict): # noqa return self._do_post(run, **container_dict) @base.Controller.api_version("1.40") # noqa @@ -299,7 +299,7 @@ class ContainersController(base.Controller): @exception.wrap_pecan_controller_exception @validation.validate_query_param(pecan.request, schema.query_param_create) @validation.validated(schema.container_create_v140) - def post(self, run=False, **container_dict): + def post(self, run=False, **container_dict): # noqa return self._do_post(run, **container_dict) def _do_post(self, run=False, **container_dict): @@ -1108,7 +1108,7 @@ class ContainersController(base.Controller): @base.Controller.api_version("1.25") # noqa @pecan.expose('json') @exception.wrap_pecan_controller_exception - def get_archive(self, container_ident, **kwargs): + def get_archive(self, container_ident, **kwargs): # noqa """Retrieve a file/folder from a container Retrieve a file or folder from a container in the @@ -1147,7 +1147,7 @@ class ContainersController(base.Controller): @base.Controller.api_version("1.25") # noqa @pecan.expose('json') @exception.wrap_pecan_controller_exception - def put_archive(self, container_ident, **kwargs): + def put_archive(self, container_ident, **kwargs): # noqa """Insert a file/folder to container. Insert a file or folder to an existing container using @@ -1302,7 +1302,7 @@ class ContainersController(base.Controller): @base.Controller.api_version("1.18") # noqa @pecan.expose('json') @exception.wrap_pecan_controller_exception - def network_list(self, container_ident): + def network_list(self, container_ident): # noqa """Retrieve a list of networks of the container. :param container_ident: UUID or Name of a container. diff --git a/zun/tests/unit/api/controllers/test_base.py b/zun/tests/unit/api/controllers/test_base.py index ab7b53756..3ef9b20b1 100644 --- a/zun/tests/unit/api/controllers/test_base.py +++ b/zun/tests/unit/api/controllers/test_base.py @@ -394,7 +394,7 @@ class TestController(test_base.TestCase): return 'API1_1.0_1.1' @base.Controller.api_version('1.2', '1.3') # noqa - def testapi1(self): + def testapi1(self): # noqa return 'API1_1.2_1.3' @base.Controller.api_version('2.1', '2.2') @@ -402,7 +402,7 @@ class TestController(test_base.TestCase): return 'API2_2.1_2.2' @base.Controller.api_version('1.0', '2.0') # noqa - def testapi2(self): + def testapi2(self): # noqa return 'API2_1.0_2.0' controller = MyController() @@ -445,7 +445,7 @@ class TestController(test_base.TestCase): return 'API1_1.0_1.1' @base.Controller.api_version('1.2', '1.3') # noqa - def testapi1(self): + def testapi1(self): # noqa return 'API1_1.2_1.3' controller = MyController() @@ -467,7 +467,7 @@ class TestController(test_base.TestCase): return 'API1_1.0_1.1' @base.Controller.api_version('1.3', '1.4') # noqa - def testapi1(self): + def testapi1(self): # noqa return 'API1_1.3_1.4' controller = MyController()