diff --git a/fuel_tests/models/manager.py b/fuel_tests/models/manager.py index c398b4ac1..f4252fb71 100644 --- a/fuel_tests/models/manager.py +++ b/fuel_tests/models/manager.py @@ -13,6 +13,7 @@ # under the License. # pylint: disable=redefined-builtin +# noinspection PyUnresolvedReferences from six.moves import xrange # pylint: enable=redefined-builtin diff --git a/fuel_tests/tests/test_ceph.py b/fuel_tests/tests/test_ceph.py index 13422c67c..8b261e559 100644 --- a/fuel_tests/tests/test_ceph.py +++ b/fuel_tests/tests/test_ceph.py @@ -26,6 +26,7 @@ from fuelweb_test.helpers.ssh_manager import SSHManager ssh_manager = SSHManager() +# noinspection PyUnresolvedReferences class TestCephRadosGW(object): """Test class consits the tests for clustre with Ceph and RadosGW""" diff --git a/fuelweb_test/helpers/checkers.py b/fuelweb_test/helpers/checkers.py index 1104894cf..9230a5b8d 100644 --- a/fuelweb_test/helpers/checkers.py +++ b/fuelweb_test/helpers/checkers.py @@ -29,7 +29,9 @@ from proboscis.asserts import assert_equal from proboscis.asserts import assert_false from proboscis.asserts import assert_true # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib.error import HTTPError +# noinspection PyUnresolvedReferences from six.moves.urllib.error import URLError # pylint: enable=import-error import yaml @@ -923,7 +925,7 @@ def check_neutron_dhcp_lease(ip, instance_ip, instance_mac, dhcp_server_ip, dhcp_port_tag): """Check if the DHCP server offers a lease for a client with the specified MAC address - :param SSHClient remote: fuel-devops.helpers.helpers object + :param ip: remote IP :param str instance_ip: IP address of instance :param str instance_mac: MAC address that will be checked :param str dhcp_server_ip: IP address of DHCP server for request a lease diff --git a/fuelweb_test/helpers/common.py b/fuelweb_test/helpers/common.py index c72d9e5f4..282680971 100644 --- a/fuelweb_test/helpers/common.py +++ b/fuelweb_test/helpers/common.py @@ -26,9 +26,11 @@ import neutronclient.v2_0.client as neutronclient from proboscis.asserts import assert_equal import six # pylint: disable=redefined-builtin +# noinspection PyUnresolvedReferences from six.moves import xrange # pylint: enable=redefined-builtin # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves import urllib # pylint: enable=import-error diff --git a/fuelweb_test/helpers/decorators.py b/fuelweb_test/helpers/decorators.py index 9e37563a0..0a7011a84 100644 --- a/fuelweb_test/helpers/decorators.py +++ b/fuelweb_test/helpers/decorators.py @@ -26,6 +26,7 @@ from proboscis.asserts import assert_equal from proboscis.asserts import assert_true import requests # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves import urllib # pylint: enable=import-error @@ -119,7 +120,7 @@ def log_snapshot_after_test(func): try: result = func(*args, **kwargs) except SkipTest: - raise SkipTest() + raise except Exception: name = 'error_{:s}'.format(func.__name__) store_error_details(name, args[0].env) @@ -522,6 +523,7 @@ def __getcallargs(func, *positional, **named): if sys.version_info.major < 3: return inspect.getcallargs(func, *positional, **named) else: + # noinspection PyUnresolvedReferences return inspect.signature(func).bind(*positional, **named).arguments @@ -546,6 +548,7 @@ def __get_arg_names(func): if sys.version_info.major < 3: return [arg for arg in inspect.getargspec(func=func).args] else: + # noinspection PyUnresolvedReferences return list(inspect.signature(obj=func).parameters.keys()) # pylint:enable=no-member diff --git a/fuelweb_test/helpers/fuel_actions.py b/fuelweb_test/helpers/fuel_actions.py index c43cdc45c..61fbfa523 100644 --- a/fuelweb_test/helpers/fuel_actions.py +++ b/fuelweb_test/helpers/fuel_actions.py @@ -14,6 +14,7 @@ import os import re +# noinspection PyUnresolvedReferences from six.moves import cStringIO from devops.helpers.helpers import wait diff --git a/fuelweb_test/helpers/gerrit/gerrit_info_provider.py b/fuelweb_test/helpers/gerrit/gerrit_info_provider.py index 5e94facd9..22d5dd345 100644 --- a/fuelweb_test/helpers/gerrit/gerrit_info_provider.py +++ b/fuelweb_test/helpers/gerrit/gerrit_info_provider.py @@ -18,6 +18,7 @@ import os import re # pylint: disable=redefined-builtin +# noinspection PyUnresolvedReferences from six.moves import xrange # pylint: enable=redefined-builtin diff --git a/fuelweb_test/helpers/http.py b/fuelweb_test/helpers/http.py index d8a24a720..2e9192acb 100644 --- a/fuelweb_test/helpers/http.py +++ b/fuelweb_test/helpers/http.py @@ -18,7 +18,9 @@ import traceback from keystoneclient.v2_0 import Client as KeystoneClient from keystoneclient import exceptions # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib import request +# noinspection PyUnresolvedReferences from six.moves.urllib.error import HTTPError # pylint: enable=import-error diff --git a/fuelweb_test/helpers/nessus.py b/fuelweb_test/helpers/nessus.py index 037ebb343..26f865b29 100644 --- a/fuelweb_test/helpers/nessus.py +++ b/fuelweb_test/helpers/nessus.py @@ -5,6 +5,7 @@ from devops.helpers.helpers import wait from proboscis import asserts import requests # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves import urllib # pylint: enable=import-error diff --git a/fuelweb_test/helpers/patching.py b/fuelweb_test/helpers/patching.py index b0c9b0353..bc8e3e585 100644 --- a/fuelweb_test/helpers/patching.py +++ b/fuelweb_test/helpers/patching.py @@ -26,7 +26,9 @@ from proboscis.asserts import assert_is_not_none from proboscis.asserts import assert_not_equal from proboscis.asserts import assert_true # pylint: disable=import-error,wrong-import-order +# noinspection PyUnresolvedReferences from six.moves.urllib.request import urlopen +# noinspection PyUnresolvedReferences from six.moves.urllib.parse import urlparse # pylint: enable=import-error,wrong-import-order import yaml diff --git a/fuelweb_test/helpers/regenerate_repo.py b/fuelweb_test/helpers/regenerate_repo.py index 0053738a4..3efab997d 100644 --- a/fuelweb_test/helpers/regenerate_repo.py +++ b/fuelweb_test/helpers/regenerate_repo.py @@ -20,8 +20,11 @@ import zlib from proboscis.asserts import assert_equal # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib.request import urlopen +# noinspection PyUnresolvedReferences from six.moves.urllib.error import HTTPError +# noinspection PyUnresolvedReferences from six.moves.urllib.error import URLError # pylint: enable=import-error diff --git a/fuelweb_test/helpers/regenerate_ubuntu_repo b/fuelweb_test/helpers/regenerate_ubuntu_repo index ed7abe2fc..31fd0ce8b 100644 --- a/fuelweb_test/helpers/regenerate_ubuntu_repo +++ b/fuelweb_test/helpers/regenerate_ubuntu_repo @@ -78,7 +78,7 @@ c1=(MD5Sum: SHA1: SHA256: SHA512:) c2=(md5 sha1 sha256 sha512) i=0 -while [ $i -lt ${#c1[*]} ]; do +while [ ${i} -lt ${#c1[*]} ]; do echo ${c1[i]} for hashme in `find ${SECTION} -type f \( -not -name "*~" -name "Package*" -o -name "Release*" \)`; do ohash=`openssl dgst -${c2[$i]} ${hashme}` diff --git a/fuelweb_test/helpers/ssh_manager.py b/fuelweb_test/helpers/ssh_manager.py index 49ea30a1f..81e48bef6 100644 --- a/fuelweb_test/helpers/ssh_manager.py +++ b/fuelweb_test/helpers/ssh_manager.py @@ -55,8 +55,10 @@ class SSHManager(object): """ It will be moved to __init__ :param admin_ip: ip address of admin node - :param login: user name - :param password: password for user + :param admin_login: user name + :param admin_password: password for user + :param slave_login: user name + :param slave_password: password for user :return: None """ self.admin_ip = admin_ip diff --git a/fuelweb_test/helpers/utils.py b/fuelweb_test/helpers/utils.py index 957a2d693..a0a0a7e21 100644 --- a/fuelweb_test/helpers/utils.py +++ b/fuelweb_test/helpers/utils.py @@ -32,9 +32,11 @@ from proboscis import asserts from proboscis.asserts import assert_true from proboscis.asserts import assert_equal # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves import configparser # pylint: enable=import-error # pylint: disable=redefined-builtin +# noinspection PyUnresolvedReferences from six.moves import xrange # pylint: enable=redefined-builtin import yaml @@ -1113,7 +1115,7 @@ def get_file_size(ip, file_name, file_path): def get_quantity_of_numa(ip): """Get number of NUMA nodes that are contained on remote node - :param remote: node IP + :param ip: node IP :return: int, count of available NUMA nodes on the node """ @@ -1140,7 +1142,7 @@ def dict_merge(a, b): if not isinstance(b, dict): return copy.deepcopy(b) result = copy.deepcopy(a) - for k, v in b.iteritems(): + for k, v in b.items(): if k in result and isinstance(result[k], dict): result[k] = dict_merge(result[k], v) else: diff --git a/fuelweb_test/models/fuel_web_client.py b/fuelweb_test/models/fuel_web_client.py index 356693b7e..7573854a4 100644 --- a/fuelweb_test/models/fuel_web_client.py +++ b/fuelweb_test/models/fuel_web_client.py @@ -34,6 +34,7 @@ from proboscis.asserts import assert_not_equal from proboscis.asserts import assert_raises from proboscis.asserts import assert_true # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib.error import HTTPError # pylint: enable=import-error import yaml @@ -340,8 +341,8 @@ class FuelWebClient29(object): task = self.task_wait(task, timeout, interval) assert_equal( 'error', task['status'], - "Task '{name}' has incorrect status. {} != {}".format( - task['status'], 'error', name=task["name"] + "Task '{name}' has incorrect status. {status} != {exp}".format( + status=task['status'], exp='error', name=task["name"] ) ) @@ -487,7 +488,7 @@ class FuelWebClient29(object): :param settings: :param port: :param configure_ssl: - :param cgroup_data: + :param release_id: :return: cluster_id """ logger.info('Create cluster with name %s', name) @@ -1969,7 +1970,7 @@ class FuelWebClient29(object): cmd = 'ip netns exec {0} ip -4 ' \ '-o address show {1}'.format(namespace, interface) else: - cmd = 'ip -4 -o address show {1}'.format(interface) + cmd = 'ip -4 -o address show {0}'.format(interface) with self.get_ssh_for_node(node_name) as remote: ret = remote.check_call(cmd) @@ -2843,14 +2844,17 @@ class FuelWebClient30(FuelWebClient29): self.environment.d_env.get_groups()} ng_nets = [] for rack in self.environment.d_env.get_groups(): - nets = {'name': rack.name} - nets['networks'] = {r.name: r.address_pool.name for - r in rack.get_network_pools( - name__in=['fuelweb_admin', - 'public', - 'management', - 'storage', - 'private'])} + nets = { + 'name': rack.name, + 'networks': { + r.name: r.address_pool.name + for r in rack.get_network_pools( + name__in=[ + 'fuelweb_admin', + 'public', + 'management', + 'storage', + 'private'])}} ng_nets.append(nets) self.update_nodegroups(cluster_id=cluster_id, node_groups=ng) @@ -3087,6 +3091,7 @@ class FuelWebClient30(FuelWebClient29): # TODO(ddmitriev): this code will be removed after moving to fuel-devops3.0 # pylint: disable=no-member +# noinspection PyUnresolvedReferences if (distutils.version.LooseVersion(devops.__version__) < distutils.version.LooseVersion('3')): logger.info("Use FuelWebClient compatible to fuel-devops 2.9") diff --git a/fuelweb_test/testrail/builds.py b/fuelweb_test/testrail/builds.py index 5c2598042..62d4bd636 100644 --- a/fuelweb_test/testrail/builds.py +++ b/fuelweb_test/testrail/builds.py @@ -18,6 +18,7 @@ import json import re # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib import request # pylint: enable=import-error diff --git a/fuelweb_test/testrail/report_pi.py b/fuelweb_test/testrail/report_pi.py index 7b82d03c3..78a1315b8 100644 --- a/fuelweb_test/testrail/report_pi.py +++ b/fuelweb_test/testrail/report_pi.py @@ -21,6 +21,7 @@ import json from logging import DEBUG from optparse import OptionParser # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib.request import urlopen # pylint: enable=import-error diff --git a/fuelweb_test/testrail/report_tempest_results.py b/fuelweb_test/testrail/report_tempest_results.py index b1a8b0c5f..09cd1d247 100644 --- a/fuelweb_test/testrail/report_tempest_results.py +++ b/fuelweb_test/testrail/report_tempest_results.py @@ -20,6 +20,7 @@ import optparse from xml.etree import ElementTree # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves import urllib # pylint: enable=import-error diff --git a/fuelweb_test/testrail/testrail.py b/fuelweb_test/testrail/testrail.py index 4e00e8293..e3a95cdef 100644 --- a/fuelweb_test/testrail/testrail.py +++ b/fuelweb_test/testrail/testrail.py @@ -30,8 +30,11 @@ import json import time # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib.request import urlopen +# noinspection PyUnresolvedReferences from six.moves.urllib.request import Request +# noinspection PyUnresolvedReferences from six.moves.urllib.error import HTTPError # pylint: enable=import-error diff --git a/fuelweb_test/tests/plugins/plugin_emc/test_plugin_emc.py b/fuelweb_test/tests/plugins/plugin_emc/test_plugin_emc.py index 0662ff438..01d4de732 100644 --- a/fuelweb_test/tests/plugins/plugin_emc/test_plugin_emc.py +++ b/fuelweb_test/tests/plugins/plugin_emc/test_plugin_emc.py @@ -16,7 +16,9 @@ import os from proboscis import asserts from proboscis import test # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves import configparser +# noinspection PyUnresolvedReferences from six.moves import cStringIO # pylint: enable=import-error diff --git a/fuelweb_test/tests/plugins/plugin_zabbix/test_plugin_zabbix.py b/fuelweb_test/tests/plugins/plugin_zabbix/test_plugin_zabbix.py index b4823444b..9d62f1e06 100644 --- a/fuelweb_test/tests/plugins/plugin_zabbix/test_plugin_zabbix.py +++ b/fuelweb_test/tests/plugins/plugin_zabbix/test_plugin_zabbix.py @@ -21,6 +21,7 @@ from proboscis.asserts import assert_true from proboscis import test import requests # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves import urllib # pylint: enable=import-error diff --git a/fuelweb_test/tests/test_admin_node.py b/fuelweb_test/tests/test_admin_node.py index fc20685be..e0c935a07 100644 --- a/fuelweb_test/tests/test_admin_node.py +++ b/fuelweb_test/tests/test_admin_node.py @@ -24,7 +24,9 @@ from proboscis.asserts import assert_equal from proboscis.asserts import assert_true from proboscis import test # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib.request import urlopen +# noinspection PyUnresolvedReferences from six.moves.xmlrpc_client import ServerProxy # pylint: enable=import-error diff --git a/fuelweb_test/tests/test_bonding.py b/fuelweb_test/tests/test_bonding.py index 38b9cb2d6..6e8f78e6c 100644 --- a/fuelweb_test/tests/test_bonding.py +++ b/fuelweb_test/tests/test_bonding.py @@ -18,6 +18,7 @@ from proboscis.asserts import assert_equal from proboscis.asserts import assert_raises from proboscis import test # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib.error import HTTPError # pylint: enable=import-error diff --git a/fuelweb_test/tests/test_cli_base.py b/fuelweb_test/tests/test_cli_base.py index 5d9c81952..a5723efd0 100644 --- a/fuelweb_test/tests/test_cli_base.py +++ b/fuelweb_test/tests/test_cli_base.py @@ -21,6 +21,7 @@ from proboscis.asserts import assert_true from devops.error import TimeoutError from devops.helpers.helpers import wait # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves import urllib # pylint: enable=import-error @@ -108,8 +109,8 @@ class CommandLine(TestBasic): .format(took=took, task=task)) assert_equal( task['status'], 'ready', - "Task '{name}' has incorrect status. {} != {}".format( - task['status'], 'ready', name=task["name"] + "Task '{name}' has incorrect status. {status} != {exp}".format( + status=task['status'], exp='ready', name=task["name"] ) ) diff --git a/fuelweb_test/tests/test_clone_env.py b/fuelweb_test/tests/test_clone_env.py index f4af38ab7..cd439a4f3 100644 --- a/fuelweb_test/tests/test_clone_env.py +++ b/fuelweb_test/tests/test_clone_env.py @@ -17,6 +17,7 @@ from proboscis.asserts import fail from proboscis import test from proboscis import SkipTest # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib.error import HTTPError # pylint: enable=import-error diff --git a/fuelweb_test/tests/test_cpu_pinning.py b/fuelweb_test/tests/test_cpu_pinning.py index 3b655fa0e..f984784e7 100644 --- a/fuelweb_test/tests/test_cpu_pinning.py +++ b/fuelweb_test/tests/test_cpu_pinning.py @@ -17,6 +17,7 @@ import random from proboscis import asserts from proboscis import test # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib.error import HTTPError # pylint: enable=import-error diff --git a/fuelweb_test/tests/test_custom_hostname.py b/fuelweb_test/tests/test_custom_hostname.py index 950184827..2b16c11fd 100644 --- a/fuelweb_test/tests/test_custom_hostname.py +++ b/fuelweb_test/tests/test_custom_hostname.py @@ -19,6 +19,7 @@ from proboscis.asserts import assert_raises from proboscis.asserts import assert_true from proboscis import test # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib.error import HTTPError # pylint: enable=import-error diff --git a/fuelweb_test/tests/test_node_reassignment.py b/fuelweb_test/tests/test_node_reassignment.py index 76c6f0dcc..6e01ff67c 100644 --- a/fuelweb_test/tests/test_node_reassignment.py +++ b/fuelweb_test/tests/test_node_reassignment.py @@ -17,6 +17,7 @@ from proboscis.asserts import fail from proboscis import test from proboscis import SkipTest # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib.error import HTTPError # pylint: enable=import-error diff --git a/fuelweb_test/tests/test_services_reconfiguration.py b/fuelweb_test/tests/test_services_reconfiguration.py index e3daa1787..e49301d69 100644 --- a/fuelweb_test/tests/test_services_reconfiguration.py +++ b/fuelweb_test/tests/test_services_reconfiguration.py @@ -21,6 +21,7 @@ import netaddr from proboscis import asserts from proboscis import test # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib.error import HTTPError # pylint: enable=import-error @@ -118,6 +119,7 @@ class ServicesReconfiguration(TestBasic): else: new_range = [default_range[0] + number_excluded_ips + 1, default_range[1]] + # noinspection PyUnresolvedReferences default_network["ip_ranges"][0] = [str(ip) for ip in new_range] diff --git a/fuelweb_test/tests/test_ssl.py b/fuelweb_test/tests/test_ssl.py index aafa19967..5e8cfb567 100644 --- a/fuelweb_test/tests/test_ssl.py +++ b/fuelweb_test/tests/test_ssl.py @@ -15,7 +15,9 @@ from proboscis import test from proboscis.asserts import assert_equal # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves import http_client +# noinspection PyUnresolvedReferences from six.moves import urllib # pylint: enable=import-error diff --git a/fuelweb_test/tests/tests_patching/test_patching.py b/fuelweb_test/tests/tests_patching/test_patching.py index b1a5e3124..f2527468b 100644 --- a/fuelweb_test/tests/tests_patching/test_patching.py +++ b/fuelweb_test/tests/tests_patching/test_patching.py @@ -19,6 +19,7 @@ from proboscis import test from proboscis.asserts import assert_is_not_none from proboscis.asserts import assert_true # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib.request import urlopen # pylint: enable=import-error diff --git a/fuelweb_test/tests/tests_scale/test_scale_group_1.py b/fuelweb_test/tests/tests_scale/test_scale_group_1.py index 9bf8e0177..5083417c5 100644 --- a/fuelweb_test/tests/tests_scale/test_scale_group_1.py +++ b/fuelweb_test/tests/tests_scale/test_scale_group_1.py @@ -15,6 +15,7 @@ from proboscis import asserts from proboscis import test # pylint: disable=import-error +# noinspection PyUnresolvedReferences from six.moves.urllib.error import HTTPError # pylint: enable=import-error diff --git a/fuelweb_test/tests/tests_strength/test_failover_base.py b/fuelweb_test/tests/tests_strength/test_failover_base.py index f74017300..ea4e6197c 100644 --- a/fuelweb_test/tests/tests_strength/test_failover_base.py +++ b/fuelweb_test/tests/tests_strength/test_failover_base.py @@ -25,6 +25,7 @@ from proboscis.asserts import assert_not_equal from proboscis.asserts import assert_true from proboscis import SkipTest # pylint: disable=redefined-builtin +# noinspection PyUnresolvedReferences from six.moves import xrange # pylint: enable=redefined-builtin import yaml diff --git a/fuelweb_test/tests/tests_strength/test_repetitive_restart.py b/fuelweb_test/tests/tests_strength/test_repetitive_restart.py index 9c5c412cd..e8d09ccaf 100644 --- a/fuelweb_test/tests/tests_strength/test_repetitive_restart.py +++ b/fuelweb_test/tests/tests_strength/test_repetitive_restart.py @@ -17,6 +17,7 @@ import time from proboscis import test from proboscis.asserts import assert_true # pylint: disable=redefined-builtin +# noinspection PyUnresolvedReferences from six.moves import xrange # pylint: enable=redefined-builtin diff --git a/system_test/actions/base.py b/system_test/actions/base.py index 436029eda..92a75793a 100644 --- a/system_test/actions/base.py +++ b/system_test/actions/base.py @@ -24,6 +24,7 @@ from proboscis import SkipTest from proboscis.asserts import assert_equal from proboscis.asserts import assert_true # pylint: disable=redefined-builtin +# noinspection PyUnresolvedReferences from six.moves import xrange # pylint: enable=redefined-builtin @@ -46,6 +47,7 @@ from system_test.helpers.decorators import make_snapshot_if_step_fail # pylint: disable=no-member +# noinspection PyUnresolvedReferences class PrepareActions(object): """Base class with prepare actions @@ -157,8 +159,8 @@ class PrepareActions(object): dns_ext = ''.join(settings.EXTERNAL_DNS) hostname = ''.join((settings.FUEL_MASTER_HOSTNAME, settings.DNS_SUFFIX)) - user = settings.SSH_CREDENTIALS['login'] - password = settings.SSH_CREDENTIALS['password'] + user = settings.SSH_FUEL_CREDENTIALS['login'] + password = settings.SSH_FUEL_CREDENTIALS['password'] generate_cloud_image_settings(cloud_image_settings_path, admin_network, interface_name, admin_ip, admin_netmask, gateway, dns, dns_ext, @@ -225,6 +227,7 @@ class PrepareActions(object): snapshot_name = "ready_with_{}_slaves".format(slaves) self.env.revert_snapshot(snapshot_name) + # noinspection PyMethodParameters @nested_action def prepare_admin_node_with_slaves(): """Combine preparation steps in alias""" @@ -236,6 +239,7 @@ class PrepareActions(object): ] +# noinspection PyUnresolvedReferences class BaseActions(PrepareActions, HealthCheckActions, PluginsActions): """Basic actions for acceptance cases diff --git a/system_test/actions/fuelmaster_actions.py b/system_test/actions/fuelmaster_actions.py index c276241b0..c303979b0 100644 --- a/system_test/actions/fuelmaster_actions.py +++ b/system_test/actions/fuelmaster_actions.py @@ -20,6 +20,7 @@ from system_test.helpers.decorators import make_snapshot_if_step_fail # pylint: disable=no-member +# noinspection PyUnresolvedReferences class FuelMasterActions(object): """Actions specific only to Fuel Master node diff --git a/system_test/actions/ostf_actions.py b/system_test/actions/ostf_actions.py index 74c949139..263424013 100644 --- a/system_test/actions/ostf_actions.py +++ b/system_test/actions/ostf_actions.py @@ -21,6 +21,7 @@ from system_test.helpers.decorators import make_snapshot_if_step_fail # pylint: disable=no-member +# noinspection PyUnresolvedReferences class HealthCheckActions(object): """Basic actions for OSTF tests diff --git a/system_test/actions/plugins_actions.py b/system_test/actions/plugins_actions.py index d1a4d04d0..baa4ef944 100644 --- a/system_test/actions/plugins_actions.py +++ b/system_test/actions/plugins_actions.py @@ -26,11 +26,13 @@ from system_test.helpers.decorators import make_snapshot_if_step_fail # pylint: disable=no-member +# noinspection PyUnresolvedReferences class PluginsActions(object): plugin_name = None plugin_path = None + # noinspection PyMethodParameters @nested_action def prepare_env_with_plugin(): return [ diff --git a/system_test/actions/strength_actions.py b/system_test/actions/strength_actions.py index e3184b2bc..ff4860acd 100644 --- a/system_test/actions/strength_actions.py +++ b/system_test/actions/strength_actions.py @@ -31,6 +31,7 @@ from system_test.helpers.decorators import make_snapshot_if_step_fail # pylint: disable=no-member +# noinspection PyUnresolvedReferences class StrengthActions(object): destroyed_devops_nodes = [] @@ -110,6 +111,7 @@ class StrengthActions(object): self.destroyed_devops_nodes) +# noinspection PyUnresolvedReferences class FillRootActions(object): ostf_tests_should_failed = 0 diff --git a/system_test/actions/vcenter_actions.py b/system_test/actions/vcenter_actions.py index 22012b827..f041bab70 100644 --- a/system_test/actions/vcenter_actions.py +++ b/system_test/actions/vcenter_actions.py @@ -29,6 +29,7 @@ from system_test.helpers.decorators import make_snapshot_if_step_fail # pylint: disable=no-member +# noinspection PyUnresolvedReferences class VMwareActions(object): """VMware vCenter/DVS related actions""" diff --git a/system_test/core/config.py b/system_test/core/config.py index 5c85837a5..21fde96ca 100644 --- a/system_test/core/config.py +++ b/system_test/core/config.py @@ -30,9 +30,10 @@ def cached_add_group(yamls): validate_config=True): """Add user friendly group - :type group_name: str + :type group: str :type systest_group: str :type config_name: str + :type validate_config: bool """ if validate_config and config_name not in yamls: diff --git a/system_test/core/factory.py b/system_test/core/factory.py index 4691a85af..fd502f81c 100644 --- a/system_test/core/factory.py +++ b/system_test/core/factory.py @@ -83,7 +83,7 @@ class ActionsFactory(object): actions_method = cls.get_actions() linear_order = [] # pylint: disable=no-member - + # noinspection PyUnresolvedReferences for action in cls.actions_order: try: action_method = actions_method[action] @@ -98,6 +98,7 @@ class ActionsFactory(object): for (n, l) in cutted] cutted = ["Line {line_num:04d}: {line}".format( line_num=n, line=l) for (n, l) in cutted] + # noinspection PyUnresolvedReferences raise LookupError("Class {} orders to run '{}' action as {} " "step,\n\tbut action method doesn't exist " "in class.\nLook at '{}':\n\n{}".format( @@ -206,7 +207,9 @@ class ActionsFactory(object): # Generate test case groups # pylint: disable=no-member + # noinspection PyUnresolvedReferences groups = ['{}({})'.format(g, case_group) for g in cls._base_groups] + # noinspection PyUnresolvedReferences groups = cls._base_groups + groups # pylint: enable=no-member diff --git a/system_test/helpers/decorators.py b/system_test/helpers/decorators.py index 1ecbf3273..56d61fd1c 100644 --- a/system_test/helpers/decorators.py +++ b/system_test/helpers/decorators.py @@ -39,7 +39,7 @@ def make_snapshot_if_step_fail(func): try: result = func(*args, **kwargs) except SkipTest: - raise SkipTest() + raise except Exception: name = 'error_%s' % func.__name__ case_name = getattr(func, '_base_class', None) diff --git a/utils/jenkins/system_tests.sh b/utils/jenkins/system_tests.sh index 50d196d30..2b1cd52c7 100755 --- a/utils/jenkins/system_tests.sh +++ b/utils/jenkins/system_tests.sh @@ -137,7 +137,7 @@ GlobalVariables() { GetoptsVariables() { while getopts ":w:j:i:t:o:a:A:m:U:r:b:V:l:LdkKe:v:h" opt; do - case $opt in + case ${opt} in w) WORKSPACE="${OPTARG}" ;; @@ -202,12 +202,12 @@ GetoptsVariables() { \?) echo "Invalid option: -$OPTARG" ShowHelp - exit $INVALIDOPTS_ERR + exit ${INVALIDOPTS_ERR} ;; :) echo "Option -$OPTARG requires an argument." ShowHelp - exit $INVALIDOPTS_ERR + exit ${INVALIDOPTS_ERR} ;; esac done @@ -217,22 +217,22 @@ CheckVariables() { if [ -z "${JOB_NAME}" ]; then echo "Error! JOB_NAME is not set!" - exit $NOJOBNAME_ERR + exit ${NOJOBNAME_ERR} fi if [ -z "${ISO_PATH}" ]; then echo "Error! ISO_PATH is not set!" - exit $NOISOPATH_ERR + exit ${NOISOPATH_ERR} fi if [ -z "${TASK_NAME}" ]; then echo "Error! TASK_NAME is not set!" - exit $NOTASKNAME_ERR + exit ${NOTASKNAME_ERR} fi if [ -z "${WORKSPACE}" ]; then echo "Error! WORKSPACE is not set!" - exit $NOWORKSPACE_ERR + exit ${NOWORKSPACE_ERR} fi } @@ -249,7 +249,7 @@ MakeISO() { if [ "${ec}" -gt "0" ]; then echo "Error! Deep clean failed!" - exit $DEEPCLEAN_ERR + exit ${DEEPCLEAN_ERR} fi # create ISO file @@ -263,7 +263,7 @@ MakeISO() { if [ "${ec}" -gt "0" ]; then echo "Error making ISO!" - exit $MAKEISO_ERR + exit ${MAKEISO_ERR} fi if [ "${DRY_RUN}" = "yes" ]; then @@ -273,7 +273,7 @@ MakeISO() { # check that ISO file exists if [ ! -f "${ISO}" ]; then echo "Error! ISO file not found!" - exit $NOISOFOUND_ERR + exit ${NOISOFOUND_ERR} fi fi @@ -294,7 +294,7 @@ MakeISO() { if [ "${ec}" -gt "0" ]; then echo "Error! Copy ${ISO} to ${NEW_BUILD_ISO_PATH} failed!" - exit $COPYISO_ERR + exit ${COPYISO_ERR} fi # create symlink to the last built ISO file @@ -307,7 +307,7 @@ MakeISO() { if [ "${ec}" -gt "0" ]; then echo "Error! Create symlink from ${NEW_BUILD_ISO_PATH} to ${ISO_PATH} failed!" - exit $SYMLINKISO_ERR + exit ${SYMLINKISO_ERR} fi else # just copy file to shared dir @@ -320,13 +320,13 @@ MakeISO() { if [ "${ec}" -gt "0" ]; then echo "Error! Copy ${ISO} to ${ISO_PATH} failed!" - exit $COPYISO_ERR + exit ${COPYISO_ERR} fi fi if [ "${ec}" -gt "0" ]; then echo "Error! Copy ISO from ${ISO} to ${ISO_PATH} failed!" - exit $COPYISO_ERR + exit ${COPYISO_ERR} fi echo "Finished building ISO: ${ISO_PATH}" exit 0 @@ -340,7 +340,7 @@ CdWorkSpace() { if [ "${ec}" -gt "0" ]; then echo "Error! Cannot cd to WORKSPACE!" - exit $CDWORKSPACE_ERR + exit ${CDWORKSPACE_ERR} fi else echo cd "${WORKSPACE}" @@ -354,7 +354,7 @@ RunTest() { if [ ! -f "${ISO_PATH}" ]; then if [ -z "${ISO_URL}" -a "${DRY_RUN}" != "yes" ]; then echo "Error! File ${ISO_PATH} not found and no ISO_URL (-U key) for downloading!" - exit $NOISOFOUND_ERR + exit ${NOISOFOUND_ERR} else if [ "${DRY_RUN}" = "yes" ]; then echo wget -c ${ISO_URL} -O ${ISO_PATH} @@ -362,9 +362,9 @@ RunTest() { echo "No ${ISO_PATH} found. Trying to download file." wget -c ${ISO_URL} -O ${ISO_PATH} rc=$? - if [ $rc -ne 0 ]; then + if [ ${rc} -ne 0 ]; then echo "Failed to fetch ISO from ${ISO_URL}" - exit $ISODOWNLOAD_ERR + exit ${ISODOWNLOAD_ERR} fi fi fi @@ -377,9 +377,9 @@ RunTest() { # run python virtualenv if [ "${VENV}" = "yes" ]; then if [ "${DRY_RUN}" = "yes" ]; then - echo . $VENV_PATH/bin/activate + echo . ${VENV_PATH}/bin/activate else - . $VENV_PATH/bin/activate + . ${VENV_PATH}/bin/activate fi fi @@ -392,7 +392,7 @@ RunTest() { fi if [ ! -f "$LOGS_DIR" ]; then - mkdir -p $LOGS_DIR + mkdir -p ${LOGS_DIR} fi export ENV_NAME @@ -468,7 +468,7 @@ RouteTasks() { ;; *) echo "Unknown task: ${TASK_NAME}!" - exit $INVALIDTASK_ERR + exit ${INVALIDTASK_ERR} ;; esac exit 0