From 2a61e7dc1f28c0ab7694b4c2855764358ee1a4ee Mon Sep 17 00:00:00 2001 From: Sharma-Ritika Date: Wed, 9 Sep 2020 13:27:55 +0530 Subject: [PATCH] [goal] Prepare pep8 testing for Ubuntu Focal As per victoria cycle testing runtime and community goal, we need to migrate upstream CI/CD to Ubuntu Focal(20.04). Add noqa doe C901 and F811 pep8 for Focal, failure can be seen in - https://review.opendev.org/#/c/743130 Depends-On: https://review.opendev.org/#/c/738328/ Change-Id: I95fa40551d842ce652ab937b8848c64f09a3e131 Story: #2007865 Task: #40190 --- magnum/api/controllers/v1/bay.py | 8 ++++---- magnum/api/controllers/v1/cluster.py | 2 +- magnum/api/controllers/v1/cluster_template.py | 2 +- magnum/common/cert_manager/local_cert_manager.py | 2 +- magnum/tests/unit/api/controllers/test_base.py | 8 ++++---- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/magnum/api/controllers/v1/bay.py b/magnum/api/controllers/v1/bay.py index 5f11a5a91f..79c1de6372 100755 --- a/magnum/api/controllers/v1/bay.py +++ b/magnum/api/controllers/v1/bay.py @@ -441,7 +441,7 @@ class BaysController(base.Controller): @base.Controller.api_version("1.2") # noqa @expose.expose(BayID, body=Bay, status_code=202) - def post(self, bay): + def post(self, bay): # noqa """Create a new bay. :param bay: a bay within the request body. @@ -513,7 +513,7 @@ class BaysController(base.Controller): @wsme.validate(types.uuid, [BayPatchType]) @expose.expose(BayID, types.uuid_or_name, body=[BayPatchType], status_code=202) - def patch(self, bay_ident, patch): + def patch(self, bay_ident, patch): # noqa """Update an existing bay. :param bay_ident: UUID or logical name of a bay. @@ -527,7 +527,7 @@ class BaysController(base.Controller): @wsme.validate(types.uuid, bool, [BayPatchType]) @expose.expose(BayID, types.uuid_or_name, types.boolean, body=[BayPatchType], status_code=202) - def patch(self, bay_ident, rollback=False, patch=None): + def patch(self, bay_ident, rollback=False, patch=None): # noqa """Update an existing bay. :param bay_ident: UUID or logical name of a bay. @@ -585,7 +585,7 @@ class BaysController(base.Controller): @base.Controller.api_version("1.2") # noqa @expose.expose(None, types.uuid_or_name, status_code=204) - def delete(self, bay_ident): + def delete(self, bay_ident): # noqa """Delete a bay. :param bay_ident: UUID of a bay or logical name of the bay. diff --git a/magnum/api/controllers/v1/cluster.py b/magnum/api/controllers/v1/cluster.py index 27bbf6ef26..4fff24661e 100755 --- a/magnum/api/controllers/v1/cluster.py +++ b/magnum/api/controllers/v1/cluster.py @@ -594,7 +594,7 @@ class ClustersController(base.Controller): @wsme.validate(types.uuid, bool, [ClusterPatchType]) @expose.expose(ClusterID, types.uuid_or_name, types.boolean, body=[ClusterPatchType], status_code=202) - def patch(self, cluster_ident, rollback=False, patch=None): + def patch(self, cluster_ident, rollback=False, patch=None): # noqa """Update an existing Cluster. :param cluster_ident: UUID or logical name of a cluster. diff --git a/magnum/api/controllers/v1/cluster_template.py b/magnum/api/controllers/v1/cluster_template.py index 475112d75c..2fb6679ce4 100644 --- a/magnum/api/controllers/v1/cluster_template.py +++ b/magnum/api/controllers/v1/cluster_template.py @@ -437,7 +437,7 @@ class ClusterTemplatesController(base.Controller): body=[ClusterTemplatePatchType]) @validation.enforce_network_driver_types_update() @validation.enforce_volume_driver_types_update() - def patch(self, cluster_template_ident, patch): + def patch(self, cluster_template_ident, patch): # noqa """Update an existing ClusterTemplate. :param cluster_template_ident: UUID or logic name of a diff --git a/magnum/common/cert_manager/local_cert_manager.py b/magnum/common/cert_manager/local_cert_manager.py index 6ae82b34ad..18de43df48 100644 --- a/magnum/common/cert_manager/local_cert_manager.py +++ b/magnum/common/cert_manager/local_cert_manager.py @@ -104,7 +104,7 @@ class CertManager(cert_manager.CertManager): return cert_ref @staticmethod # noqa: C901 - def get_cert(cert_ref, **kwargs): + def get_cert(cert_ref, **kwargs): # noqa: C901 """Retrieves the specified cert. :param cert_ref: the UUID of the cert to retrieve diff --git a/magnum/tests/unit/api/controllers/test_base.py b/magnum/tests/unit/api/controllers/test_base.py index b990ede0ca..a5f0b24483 100644 --- a/magnum/tests/unit/api/controllers/test_base.py +++ b/magnum/tests/unit/api/controllers/test_base.py @@ -325,7 +325,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') @@ -333,7 +333,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() @@ -376,7 +376,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() @@ -398,7 +398,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()