From 46fa9093a10cdf624b5e86457fef5f320039f7e9 Mon Sep 17 00:00:00 2001 From: Ilias Tsitsimpis Date: Mon, 10 Feb 2014 16:04:13 +0200 Subject: [PATCH] burnin: Change pylint disable-msg pragmas 'disable-msg' has been deprecated in favor of 'disable'. --- snf-tools/synnefo_tools/burnin/__init__.py | 3 +-- .../synnefo_tools/burnin/astakos_tests.py | 2 +- snf-tools/synnefo_tools/burnin/common.py | 27 ++++++++++--------- .../synnefo_tools/burnin/cyclades_common.py | 6 ++--- .../synnefo_tools/burnin/images_tests.py | 4 +-- snf-tools/synnefo_tools/burnin/logger.py | 2 +- .../synnefo_tools/burnin/network_tests.py | 2 +- .../synnefo_tools/burnin/pithos_tests.py | 2 +- .../synnefo_tools/burnin/server_tests.py | 7 +++-- snf-tools/synnefo_tools/burnin/stale_tests.py | 6 ++--- 10 files changed, 31 insertions(+), 30 deletions(-) diff --git a/snf-tools/synnefo_tools/burnin/__init__.py b/snf-tools/synnefo_tools/burnin/__init__.py index 056ab8789..4bd02d0d0 100644 --- a/snf-tools/synnefo_tools/burnin/__init__.py +++ b/snf-tools/synnefo_tools/burnin/__init__.py @@ -92,8 +92,7 @@ def parse_arguments(args): kwargs["description"] = \ "%prog runs a number of test scenarios on a Synnefo deployment." - # Used * or ** magic. pylint: disable-msg=W0142 - parser = optparse.OptionParser(**kwargs) + parser = optparse.OptionParser(**kwargs) # pylint: disable=star-args parser.disable_interspersed_args() parser.add_option( diff --git a/snf-tools/synnefo_tools/burnin/astakos_tests.py b/snf-tools/synnefo_tools/burnin/astakos_tests.py index 02e276da0..2fb43f19f 100644 --- a/snf-tools/synnefo_tools/burnin/astakos_tests.py +++ b/snf-tools/synnefo_tools/burnin/astakos_tests.py @@ -42,7 +42,7 @@ from kamaki.clients import ClientError from synnefo_tools.burnin import common -# Too many public methods. pylint: disable-msg=R0904 +# pylint: disable=too-many-public-methods class AstakosTestSuite(common.BurninTests): """Test Astakos functionality""" def test_001_unauthorized_access(self): diff --git a/snf-tools/synnefo_tools/burnin/common.py b/snf-tools/synnefo_tools/burnin/common.py index 886b02361..1585601d1 100644 --- a/snf-tools/synnefo_tools/burnin/common.py +++ b/snf-tools/synnefo_tools/burnin/common.py @@ -54,8 +54,8 @@ from synnefo_tools.burnin.logger import Log # -------------------------------------------------------------------- # Global variables -logger = None # Invalid constant name. pylint: disable-msg=C0103 -success = None # Invalid constant name. pylint: disable-msg=C0103 +logger = None # pylint: disable=invalid-name +success = None # pylint: disable=invalid-name SNF_TEST_PREFIX = "snf-test-" CONNECTION_RETRY_LIMIT = 2 SYSTEM_USERS = ["images@okeanos.grnet.gr", "images@demo.synnefo.org"] @@ -79,7 +79,7 @@ class BurninTestResult(unittest.TestResult): super(BurninTestResult, self).startTest(test) logger.log(test.__class__.__name__, test.shortDescription()) - # Method could be a function. pylint: disable-msg=R0201 + # pylint: disable=no-self-use def _test_failed(self, test, err): """Test failed""" # Get class name @@ -108,8 +108,8 @@ class BurninTestResult(unittest.TestResult): # -------------------------------------------------------------------- # Helper Classes -# Too few public methods. pylint: disable-msg=R0903 -# Too many instance attributes. pylint: disable-msg=R0902 +# pylint: disable=too-few-public-methods +# pylint: disable=too-many-instance-attributes class Clients(object): """Our kamaki clients""" auth_url = None @@ -186,7 +186,7 @@ class Proper(object): # -------------------------------------------------------------------- # BurninTests class -# Too many public methods (45/20). pylint: disable-msg=R0904 +# pylint: disable=too-many-public-methods class BurninTests(unittest.TestCase): """Common class that all burnin tests should implement""" clients = Clients() @@ -245,7 +245,7 @@ class BurninTests(unittest.TestCase): def _run_tests(self, tcases): """Run some generated testcases""" - global success # Using global. pylint: disable-msg=C0103,W0603,W0602 + global success # pylint: disable=invalid-name, global-statement for tcase in tcases: self.info("Running testsuite %s", tcase.__name__) @@ -514,8 +514,8 @@ class BurninTests(unittest.TestCase): self.info("Getting quotas") return dict(self.clients.astakos.get_quotas()) - # Invalid argument name. pylint: disable-msg=C0103 - # Too many arguments. pylint: disable-msg=R0913 + # pylint: disable=invalid-name + # pylint: disable=too-many-arguments def _check_quotas(self, puuid=None, disk=None, vm=None, diskspace=None, ram=None, ip=None, cpu=None, network=None): """Check that quotas' changes are consistent @@ -605,7 +605,7 @@ def initialize(opts, testsuites, stale_testsuites): """ # Initialize logger - global logger # Using global statement. pylint: disable-msg=C0103,W0603 + global logger # pylint: disable=invalid-name, global-statement curr_time = datetime.datetime.now() logger = Log(opts.log_folder, verbose=opts.verbose, use_colors=opts.use_colors, in_parallel=False, @@ -647,7 +647,8 @@ def initialize(opts, testsuites, stale_testsuites): # Run Burnin def run_burnin(testsuites, failfast=False): """Run burnin testsuites""" - # Using global. pylint: disable-msg=C0103,W0603,W0602 + # pylint: disable=invalid-name,global-statement + # pylint: disable=global-variable-not-assigned global logger, success success = True @@ -662,7 +663,9 @@ def run_burnin(testsuites, failfast=False): def run_tests(tcases, failfast=False): """Run some testcases""" - global success # Using global. pylint: disable-msg=C0103,W0603,W0602 + # pylint: disable=invalid-name,global-statement + # pylint: disable=global-variable-not-assigned + global success for tcase in tcases: was_success = run_test(tcase) diff --git a/snf-tools/synnefo_tools/burnin/cyclades_common.py b/snf-tools/synnefo_tools/burnin/cyclades_common.py index 497d8a7b0..3bcce3787 100644 --- a/snf-tools/synnefo_tools/burnin/cyclades_common.py +++ b/snf-tools/synnefo_tools/burnin/cyclades_common.py @@ -52,7 +52,7 @@ from kamaki.clients import ClientError from synnefo_tools.burnin.common import BurninTests, MB, GB -# Too many public methods. pylint: disable-msg=R0904 +# pylint: disable=too-many-public-methods class CycladesTests(BurninTests): """Extends the BurninTests class for Cyclades""" def _try_until_timeout_expires(self, opmsg, check_fun): @@ -356,7 +356,7 @@ class CycladesTests(BurninTests): d_image = self.clients.cyclades.get_image_details(image['id']) return d_image['metadata']['osfamily'].lower().find(osfamily) >= 0 - # Method could be a function. pylint: disable-msg=R0201 + # pylint: disable=no-self-use def _ssh_execute(self, hostip, username, password, command): """Execute a command via ssh""" ssh = paramiko.SSHClient() @@ -393,7 +393,7 @@ class CycladesTests(BurninTests): self.info("Server's hostname is %s", hostname) return hostname - # Too many arguments. pylint: disable-msg=R0913 + # pylint: disable=too-many-arguments def _check_file_through_ssh(self, hostip, username, password, remotepath, content): """Fetch file from server and compare contents""" diff --git a/snf-tools/synnefo_tools/burnin/images_tests.py b/snf-tools/synnefo_tools/burnin/images_tests.py index 8e33cbade..c30f9f1b5 100644 --- a/snf-tools/synnefo_tools/burnin/images_tests.py +++ b/snf-tools/synnefo_tools/burnin/images_tests.py @@ -45,7 +45,7 @@ from kamaki.clients import ClientError from synnefo_tools.burnin.common import BurninTests, Proper -# Too many public methods. pylint: disable-msg=R0904 +# pylint: disable=too-many-public-methods class FlavorsTestSuite(BurninTests): """Test flavor lists for consistency""" simple_flavors = Proper(value=None) @@ -89,7 +89,7 @@ class FlavorsTestSuite(BurninTests): # -------------------------------------------------------------------- -# Too many public methods. pylint: disable-msg=R0904 +# pylint: disable=too-many-public-methods class ImagesTestSuite(BurninTests): """Test image lists for consistency""" simple_images = Proper(value=None) diff --git a/snf-tools/synnefo_tools/burnin/logger.py b/snf-tools/synnefo_tools/burnin/logger.py index d90318d11..71305188a 100644 --- a/snf-tools/synnefo_tools/burnin/logger.py +++ b/snf-tools/synnefo_tools/burnin/logger.py @@ -220,7 +220,7 @@ class Log(object): """ # ---------------------------------- - # Too many arguments. pylint: disable-msg=R0913 + # pylint: disable=too-many-arguments def __init__(self, output_dir, verbose=1, use_colors=True, in_parallel=False, log_level=0, curr_time=None): """Initialize our loggers diff --git a/snf-tools/synnefo_tools/burnin/network_tests.py b/snf-tools/synnefo_tools/burnin/network_tests.py index 69387cbd4..0d85ec3eb 100644 --- a/snf-tools/synnefo_tools/burnin/network_tests.py +++ b/snf-tools/synnefo_tools/burnin/network_tests.py @@ -42,7 +42,7 @@ from synnefo_tools.burnin.common import Proper from synnefo_tools.burnin.cyclades_common import CycladesTests -# Too many public methods. pylint: disable-msg=R0904 +# pylint: disable=too-many-public-methods class NetworkTestSuite(CycladesTests): """Test Networking in Cyclades""" avail_images = Proper(value=None) diff --git a/snf-tools/synnefo_tools/burnin/pithos_tests.py b/snf-tools/synnefo_tools/burnin/pithos_tests.py index 84b427ca2..1b5171216 100644 --- a/snf-tools/synnefo_tools/burnin/pithos_tests.py +++ b/snf-tools/synnefo_tools/burnin/pithos_tests.py @@ -43,7 +43,7 @@ import tempfile from synnefo_tools.burnin.common import BurninTests, Proper -# Too many public methods. pylint: disable-msg=R0904 +# pylint: disable=too-many-public-methods class PithosTestSuite(BurninTests): """Test Pithos functionality""" containers = Proper(value=None) diff --git a/snf-tools/synnefo_tools/burnin/server_tests.py b/snf-tools/synnefo_tools/burnin/server_tests.py index 295be3949..871cf0178 100644 --- a/snf-tools/synnefo_tools/burnin/server_tests.py +++ b/snf-tools/synnefo_tools/burnin/server_tests.py @@ -48,8 +48,7 @@ from synnefo_tools.burnin.common import BurninTests, Proper from synnefo_tools.burnin.cyclades_common import CycladesTests -# Too many public methods. pylint: disable-msg=R0904 -# Too many instance attributes. pylint: disable-msg=R0902 +# pylint: disable=too-many-public-methods,too-many-instance-attributes # This class gets replicated into actual TestCases dynamically class GeneratedServerTestSuite(CycladesTests): """Test Spawning Serverfunctionality""" @@ -248,7 +247,7 @@ class GeneratedServerTestSuite(CycladesTests): socket.AF_INET, self.ipv4[0], 3389) # No actual RDP processing done. We assume the RDP server is there # if the connection to the RDP port is successful. - # pylint: disable-msg=W0511 + # pylint: disable=fixme # FIXME: Use rdesktop, analyze exit code? see manpage sock.close() @@ -261,7 +260,7 @@ class GeneratedServerTestSuite(CycladesTests): socket.AF_INET, self.ipv6[0], 3389) # No actual RDP processing done. We assume the RDP server is there # if the connection to the RDP port is successful. - # pylint: disable-msg=W0511 + # pylint: disable=fixme # FIXME: Use rdesktop, analyze exit code? see manpage sock.close() diff --git a/snf-tools/synnefo_tools/burnin/stale_tests.py b/snf-tools/synnefo_tools/burnin/stale_tests.py index 4413a8d9b..2b0ea5686 100644 --- a/snf-tools/synnefo_tools/burnin/stale_tests.py +++ b/snf-tools/synnefo_tools/burnin/stale_tests.py @@ -40,7 +40,7 @@ from synnefo_tools.burnin.common import Proper, SNF_TEST_PREFIX from synnefo_tools.burnin.cyclades_common import CycladesTests -# Too many public methods. pylint: disable-msg=R0904 +# pylint: disable=too-many-public-methods class StaleServersTestSuite(CycladesTests): """Handle stale Servers""" stale_servers = Proper(value=None) @@ -72,7 +72,7 @@ class StaleServersTestSuite(CycladesTests): self._delete_servers(self.stale_servers, error=True) -# Too many public methods. pylint: disable-msg=R0904 +# pylint: disable=too-many-public-methods class StaleFloatingIPsTestSuite(CycladesTests): """Handle stale Floating IPs""" stale_ips = Proper(value=None) @@ -107,7 +107,7 @@ class StaleFloatingIPsTestSuite(CycladesTests): self._delete_floating_ips(self.stale_ips) -# Too many public methods. pylint: disable-msg=R0904 +# pylint: disable=too-many-public-methods class StaleNetworksTestSuite(CycladesTests): """Handle stale Networks""" stale_networks = Proper(value=None) -- GitLab