Commit 46fa9093 authored by Ilias Tsitsimpis's avatar Ilias Tsitsimpis Committed by Giorgos Korfiatis

burnin: Change pylint disable-msg pragmas

'disable-msg' has been deprecated in favor of 'disable'.
parent f73bc78c
...@@ -92,8 +92,7 @@ def parse_arguments(args): ...@@ -92,8 +92,7 @@ def parse_arguments(args):
kwargs["description"] = \ kwargs["description"] = \
"%prog runs a number of test scenarios on a Synnefo deployment." "%prog runs a number of test scenarios on a Synnefo deployment."
# Used * or ** magic. pylint: disable-msg=W0142 parser = optparse.OptionParser(**kwargs) # pylint: disable=star-args
parser = optparse.OptionParser(**kwargs)
parser.disable_interspersed_args() parser.disable_interspersed_args()
parser.add_option( parser.add_option(
......
...@@ -42,7 +42,7 @@ from kamaki.clients import ClientError ...@@ -42,7 +42,7 @@ from kamaki.clients import ClientError
from synnefo_tools.burnin import common from synnefo_tools.burnin import common
# Too many public methods. pylint: disable-msg=R0904 # pylint: disable=too-many-public-methods
class AstakosTestSuite(common.BurninTests): class AstakosTestSuite(common.BurninTests):
"""Test Astakos functionality""" """Test Astakos functionality"""
def test_001_unauthorized_access(self): def test_001_unauthorized_access(self):
......
...@@ -54,8 +54,8 @@ from synnefo_tools.burnin.logger import Log ...@@ -54,8 +54,8 @@ from synnefo_tools.burnin.logger import Log
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# Global variables # Global variables
logger = None # Invalid constant name. pylint: disable-msg=C0103 logger = None # pylint: disable=invalid-name
success = None # Invalid constant name. pylint: disable-msg=C0103 success = None # pylint: disable=invalid-name
SNF_TEST_PREFIX = "snf-test-" SNF_TEST_PREFIX = "snf-test-"
CONNECTION_RETRY_LIMIT = 2 CONNECTION_RETRY_LIMIT = 2
SYSTEM_USERS = ["images@okeanos.grnet.gr", "images@demo.synnefo.org"] SYSTEM_USERS = ["images@okeanos.grnet.gr", "images@demo.synnefo.org"]
...@@ -79,7 +79,7 @@ class BurninTestResult(unittest.TestResult): ...@@ -79,7 +79,7 @@ class BurninTestResult(unittest.TestResult):
super(BurninTestResult, self).startTest(test) super(BurninTestResult, self).startTest(test)
logger.log(test.__class__.__name__, test.shortDescription()) 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): def _test_failed(self, test, err):
"""Test failed""" """Test failed"""
# Get class name # Get class name
...@@ -108,8 +108,8 @@ class BurninTestResult(unittest.TestResult): ...@@ -108,8 +108,8 @@ class BurninTestResult(unittest.TestResult):
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# Helper Classes # Helper Classes
# Too few public methods. pylint: disable-msg=R0903 # pylint: disable=too-few-public-methods
# Too many instance attributes. pylint: disable-msg=R0902 # pylint: disable=too-many-instance-attributes
class Clients(object): class Clients(object):
"""Our kamaki clients""" """Our kamaki clients"""
auth_url = None auth_url = None
...@@ -186,7 +186,7 @@ class Proper(object): ...@@ -186,7 +186,7 @@ class Proper(object):
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# BurninTests class # BurninTests class
# Too many public methods (45/20). pylint: disable-msg=R0904 # pylint: disable=too-many-public-methods
class BurninTests(unittest.TestCase): class BurninTests(unittest.TestCase):
"""Common class that all burnin tests should implement""" """Common class that all burnin tests should implement"""
clients = Clients() clients = Clients()
...@@ -245,7 +245,7 @@ class BurninTests(unittest.TestCase): ...@@ -245,7 +245,7 @@ class BurninTests(unittest.TestCase):
def _run_tests(self, tcases): def _run_tests(self, tcases):
"""Run some generated testcases""" """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: for tcase in tcases:
self.info("Running testsuite %s", tcase.__name__) self.info("Running testsuite %s", tcase.__name__)
...@@ -514,8 +514,8 @@ class BurninTests(unittest.TestCase): ...@@ -514,8 +514,8 @@ class BurninTests(unittest.TestCase):
self.info("Getting quotas") self.info("Getting quotas")
return dict(self.clients.astakos.get_quotas()) return dict(self.clients.astakos.get_quotas())
# Invalid argument name. pylint: disable-msg=C0103 # pylint: disable=invalid-name
# Too many arguments. pylint: disable-msg=R0913 # pylint: disable=too-many-arguments
def _check_quotas(self, puuid=None, disk=None, vm=None, diskspace=None, def _check_quotas(self, puuid=None, disk=None, vm=None, diskspace=None,
ram=None, ip=None, cpu=None, network=None): ram=None, ip=None, cpu=None, network=None):
"""Check that quotas' changes are consistent """Check that quotas' changes are consistent
...@@ -605,7 +605,7 @@ def initialize(opts, testsuites, stale_testsuites): ...@@ -605,7 +605,7 @@ def initialize(opts, testsuites, stale_testsuites):
""" """
# Initialize logger # 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() curr_time = datetime.datetime.now()
logger = Log(opts.log_folder, verbose=opts.verbose, logger = Log(opts.log_folder, verbose=opts.verbose,
use_colors=opts.use_colors, in_parallel=False, use_colors=opts.use_colors, in_parallel=False,
...@@ -647,7 +647,8 @@ def initialize(opts, testsuites, stale_testsuites): ...@@ -647,7 +647,8 @@ def initialize(opts, testsuites, stale_testsuites):
# Run Burnin # Run Burnin
def run_burnin(testsuites, failfast=False): def run_burnin(testsuites, failfast=False):
"""Run burnin testsuites""" """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 global logger, success
success = True success = True
...@@ -662,7 +663,9 @@ def run_burnin(testsuites, failfast=False): ...@@ -662,7 +663,9 @@ def run_burnin(testsuites, failfast=False):
def run_tests(tcases, failfast=False): def run_tests(tcases, failfast=False):
"""Run some testcases""" """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: for tcase in tcases:
was_success = run_test(tcase) was_success = run_test(tcase)
......
...@@ -52,7 +52,7 @@ from kamaki.clients import ClientError ...@@ -52,7 +52,7 @@ from kamaki.clients import ClientError
from synnefo_tools.burnin.common import BurninTests, MB, GB 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): class CycladesTests(BurninTests):
"""Extends the BurninTests class for Cyclades""" """Extends the BurninTests class for Cyclades"""
def _try_until_timeout_expires(self, opmsg, check_fun): def _try_until_timeout_expires(self, opmsg, check_fun):
...@@ -356,7 +356,7 @@ class CycladesTests(BurninTests): ...@@ -356,7 +356,7 @@ class CycladesTests(BurninTests):
d_image = self.clients.cyclades.get_image_details(image['id']) d_image = self.clients.cyclades.get_image_details(image['id'])
return d_image['metadata']['osfamily'].lower().find(osfamily) >= 0 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): def _ssh_execute(self, hostip, username, password, command):
"""Execute a command via ssh""" """Execute a command via ssh"""
ssh = paramiko.SSHClient() ssh = paramiko.SSHClient()
...@@ -393,7 +393,7 @@ class CycladesTests(BurninTests): ...@@ -393,7 +393,7 @@ class CycladesTests(BurninTests):
self.info("Server's hostname is %s", hostname) self.info("Server's hostname is %s", hostname)
return hostname return hostname
# Too many arguments. pylint: disable-msg=R0913 # pylint: disable=too-many-arguments
def _check_file_through_ssh(self, hostip, username, password, def _check_file_through_ssh(self, hostip, username, password,
remotepath, content): remotepath, content):
"""Fetch file from server and compare contents""" """Fetch file from server and compare contents"""
......
...@@ -45,7 +45,7 @@ from kamaki.clients import ClientError ...@@ -45,7 +45,7 @@ from kamaki.clients import ClientError
from synnefo_tools.burnin.common import BurninTests, Proper 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): class FlavorsTestSuite(BurninTests):
"""Test flavor lists for consistency""" """Test flavor lists for consistency"""
simple_flavors = Proper(value=None) simple_flavors = Proper(value=None)
...@@ -89,7 +89,7 @@ class FlavorsTestSuite(BurninTests): ...@@ -89,7 +89,7 @@ class FlavorsTestSuite(BurninTests):
# -------------------------------------------------------------------- # --------------------------------------------------------------------
# Too many public methods. pylint: disable-msg=R0904 # pylint: disable=too-many-public-methods
class ImagesTestSuite(BurninTests): class ImagesTestSuite(BurninTests):
"""Test image lists for consistency""" """Test image lists for consistency"""
simple_images = Proper(value=None) simple_images = Proper(value=None)
......
...@@ -220,7 +220,7 @@ class Log(object): ...@@ -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, def __init__(self, output_dir, verbose=1, use_colors=True,
in_parallel=False, log_level=0, curr_time=None): in_parallel=False, log_level=0, curr_time=None):
"""Initialize our loggers """Initialize our loggers
......
...@@ -42,7 +42,7 @@ from synnefo_tools.burnin.common import Proper ...@@ -42,7 +42,7 @@ from synnefo_tools.burnin.common import Proper
from synnefo_tools.burnin.cyclades_common import CycladesTests 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): class NetworkTestSuite(CycladesTests):
"""Test Networking in Cyclades""" """Test Networking in Cyclades"""
avail_images = Proper(value=None) avail_images = Proper(value=None)
......
...@@ -43,7 +43,7 @@ import tempfile ...@@ -43,7 +43,7 @@ import tempfile
from synnefo_tools.burnin.common import BurninTests, Proper 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): class PithosTestSuite(BurninTests):
"""Test Pithos functionality""" """Test Pithos functionality"""
containers = Proper(value=None) containers = Proper(value=None)
......
...@@ -48,8 +48,7 @@ from synnefo_tools.burnin.common import BurninTests, Proper ...@@ -48,8 +48,7 @@ from synnefo_tools.burnin.common import BurninTests, Proper
from synnefo_tools.burnin.cyclades_common import CycladesTests from synnefo_tools.burnin.cyclades_common import CycladesTests
# Too many public methods. pylint: disable-msg=R0904 # pylint: disable=too-many-public-methods,too-many-instance-attributes
# Too many instance attributes. pylint: disable-msg=R0902
# This class gets replicated into actual TestCases dynamically # This class gets replicated into actual TestCases dynamically
class GeneratedServerTestSuite(CycladesTests): class GeneratedServerTestSuite(CycladesTests):
"""Test Spawning Serverfunctionality""" """Test Spawning Serverfunctionality"""
...@@ -248,7 +247,7 @@ class GeneratedServerTestSuite(CycladesTests): ...@@ -248,7 +247,7 @@ class GeneratedServerTestSuite(CycladesTests):
socket.AF_INET, self.ipv4[0], 3389) socket.AF_INET, self.ipv4[0], 3389)
# No actual RDP processing done. We assume the RDP server is there # No actual RDP processing done. We assume the RDP server is there
# if the connection to the RDP port is successful. # if the connection to the RDP port is successful.
# pylint: disable-msg=W0511 # pylint: disable=fixme
# FIXME: Use rdesktop, analyze exit code? see manpage # FIXME: Use rdesktop, analyze exit code? see manpage
sock.close() sock.close()
...@@ -261,7 +260,7 @@ class GeneratedServerTestSuite(CycladesTests): ...@@ -261,7 +260,7 @@ class GeneratedServerTestSuite(CycladesTests):
socket.AF_INET, self.ipv6[0], 3389) socket.AF_INET, self.ipv6[0], 3389)
# No actual RDP processing done. We assume the RDP server is there # No actual RDP processing done. We assume the RDP server is there
# if the connection to the RDP port is successful. # if the connection to the RDP port is successful.
# pylint: disable-msg=W0511 # pylint: disable=fixme
# FIXME: Use rdesktop, analyze exit code? see manpage # FIXME: Use rdesktop, analyze exit code? see manpage
sock.close() sock.close()
......
...@@ -40,7 +40,7 @@ from synnefo_tools.burnin.common import Proper, SNF_TEST_PREFIX ...@@ -40,7 +40,7 @@ from synnefo_tools.burnin.common import Proper, SNF_TEST_PREFIX
from synnefo_tools.burnin.cyclades_common import CycladesTests 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): class StaleServersTestSuite(CycladesTests):
"""Handle stale Servers""" """Handle stale Servers"""
stale_servers = Proper(value=None) stale_servers = Proper(value=None)
...@@ -72,7 +72,7 @@ class StaleServersTestSuite(CycladesTests): ...@@ -72,7 +72,7 @@ class StaleServersTestSuite(CycladesTests):
self._delete_servers(self.stale_servers, error=True) 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): class StaleFloatingIPsTestSuite(CycladesTests):
"""Handle stale Floating IPs""" """Handle stale Floating IPs"""
stale_ips = Proper(value=None) stale_ips = Proper(value=None)
...@@ -107,7 +107,7 @@ class StaleFloatingIPsTestSuite(CycladesTests): ...@@ -107,7 +107,7 @@ class StaleFloatingIPsTestSuite(CycladesTests):
self._delete_floating_ips(self.stale_ips) self._delete_floating_ips(self.stale_ips)
# Too many public methods. pylint: disable-msg=R0904 # pylint: disable=too-many-public-methods
class StaleNetworksTestSuite(CycladesTests): class StaleNetworksTestSuite(CycladesTests):
"""Handle stale Networks""" """Handle stale Networks"""
stale_networks = Proper(value=None) stale_networks = Proper(value=None)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment