They are highlighted by the last pylint version.
Change-Id: I473212a413013492716993fb536903b13bff66ed
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
self.excl_scenario()))
if black_tests:
- LOGGER.debug("Blacklisted tests: " + str(black_tests))
+ LOGGER.debug("Blacklisted tests: %s", str(black_tests))
include = True
for cases_line in cases_file:
# parse JSON operation result
if self.task_succeed(json_results):
- LOGGER.info('Test scenario: "{}" OK.'.format(test_name) + "\n")
+ LOGGER.info('Test scenario: "%s" OK.', test_name)
else:
- LOGGER.info('Test scenario: "{}" Failed.'.format(test_name) + "\n")
+ LOGGER.info('Test scenario: "%s" Failed.', test_name)
def _run_task(self, test_name):
"""Run a task."""
task_file = os.path.join(self.RALLY_DIR, 'task.yaml')
if not os.path.exists(task_file):
LOGGER.error("Task file '%s' does not exist.", task_file)
- raise Exception("Task file '%s' does not exist.", task_file)
+ raise Exception("Task file '{}' does not exist.".format(task_file))
file_name = self._prepare_test_list(test_name)
if self.file_is_empty(file_name):
import unittest
+from snaps.openstack.tests.create_instance_tests import SimpleHealthCheck
+from snaps.openstack.tests.os_source_file_test import OSIntegrationTestCase
+
from functest.opnfv_tests.openstack.snaps.snaps_test_runner import (
SnapsTestRunner)
-from snaps.openstack.tests.os_source_file_test import OSIntegrationTestCase
-from snaps.openstack.tests.create_instance_tests import SimpleHealthCheck
-
class HealthCheck(SnapsTestRunner):
"""
#
# http://www.apache.org/licenses/LICENSE-2.0
-"""Some common utils wrapping snaps functions """
+"""Some common utils wrapping snaps functions"""
+
+from snaps.openstack.tests import openstack_tests
+from snaps.openstack.utils import neutron_utils
+from snaps.openstack.utils import nova_utils
from functest.utils import config
from functest.utils import constants
from functest.utils import env
-from snaps.openstack.tests import openstack_tests
-from snaps.openstack.utils import neutron_utils, nova_utils
-
def get_ext_net_name(os_creds):
"""
import os_client_config
from six.moves import urllib
+from xtesting.core import robotframework
from functest.utils import config
from functest.utils import env
-from xtesting.core import robotframework
__author__ = "Cedric Ollivier <cedric.ollivier@orange.com>"
from cloudify_rest_client import CloudifyClient
from cloudify_rest_client.executions import Execution
from scp import SCPClient
-
-from functest.opnfv_tests.openstack.snaps import snaps_utils
-import functest.opnfv_tests.vnf.router.vrouter_base as vrouter_base
-from functest.opnfv_tests.vnf.router.utilvnf import Utilvnf
-from functest.utils import config
-from functest.utils import env
-from functest.utils import functest_utils
-
+import six
from snaps.config.flavor import FlavorConfig
from snaps.config.image import ImageConfig
from snaps.config.keypair import KeypairConfig
Direction, Protocol, SecurityGroupConfig, SecurityGroupRuleConfig)
from snaps.config.user import UserConfig
from snaps.config.vm_inst import FloatingIpConfig, VmInstanceConfig
-
from snaps.openstack.create_flavor import OpenStackFlavor
from snaps.openstack.create_image import OpenStackImage
from snaps.openstack.create_instance import OpenStackVmInstance
from snaps.openstack.create_security_group import OpenStackSecurityGroup
from snaps.openstack.create_router import OpenStackRouter
from snaps.openstack.create_user import OpenStackUser
-
import snaps.openstack.utils.glance_utils as glance_utils
from snaps.openstack.utils import keystone_utils
-
-import six
-
+from functest.opnfv_tests.openstack.snaps import snaps_utils
+import functest.opnfv_tests.vnf.router.vrouter_base as vrouter_base
+from functest.opnfv_tests.vnf.router.utilvnf import Utilvnf
+from functest.utils import config
+from functest.utils import env
+from functest.utils import functest_utils
__author__ = "Shuya Nakama <shuya.nakama@okinawaopenlabs.org>"
import requests
import yaml
-from functest.utils import config
from git import Repo
from snaps.openstack.utils import nova_utils
+from functest.utils import config
RESULT_SPRIT_INDEX = {
"transfer": 8,
def request_vnf_reboot(self, vnf_info_list):
for vnf in vnf_info_list:
- self.logger.debug("reboot the " + vnf["vnf_name"])
+ self.logger.debug("reboot the %s", vnf["vnf_name"])
self.reboot_vm(vnf["vnf_name"])
def request_vm_delete(self, vnf_info_list):
for vnf in vnf_info_list:
- self.logger.debug("delete the " + vnf["vnf_name"])
+ self.logger.debug("delete the %s", vnf["vnf_name"])
self.delete_vm(vnf["vnf_name"])
def get_vnf_info_list(self, cfy_manager_ip, topology_deploy_name,
vnf["target_vnf_flag"] = bool(vnf_name == target_vnf_name)
- self.logger.debug("vnf name : " + vnf_name)
+ self.logger.debug("vnf name : %s", vnf_name)
self.logger.debug(vnf_name + " floating ip address : " +
vnf["floating_ip"])
def command_list_execute(self, ssh, command_list, prompt):
res_data_list = []
for command in command_list:
- self.logger.debug("Command : " + command)
+ self.logger.debug("Command : %s", command)
(res, res_data) = self.command_execute(ssh,
command,
prompt)
- self.logger.debug("Response : " + res_data)
+ self.logger.debug("Response : %s", res_data)
res_data_list.append(res_data)
if not res:
return res, res_data_list
def command_execute(self, ssh, command, prompt):
res_data = ssh.send(command, prompt)
if res_data is None:
- self.logger.info("retry send command : " + command)
+ self.logger.info("retry send command : %s", command)
res_data = ssh.send(command,
prompt)
if not ssh.error_check(res_data):
test_list = function_test["test_list"]
target_vnf_name = function_test["target_vnf_name"]
for test_info in test_list:
- self.logger.info(test_info["protocol"] + " " +
- test_info["test_kind"] +
- " test.")
+ self.logger.info(
+ "%s %s test.", test_info["protocol"],
+ test_info["test_kind"])
(result, result_data) = self.function_test_vrouter(
target_vnf_name, test_info)
test_result_data_list.append(result_data)
@mock.patch('os_client_config.make_shade')
def _test_run(self, status=testcase.TestCase.EX_OK,
exception=None, *args, **kwargs):
+ # pylint: disable=keyword-arg-before-vararg
args[0].return_value.search_services.return_value = [
munch.Munch(id=self._neutron_id)]
args[0].return_value.search_endpoints.return_value = [
@mock.patch('os_client_config.make_shade')
def _test_multiple_suites(self, suites,
status=testcase.TestCase.EX_OK, *args, **kwargs):
+ # pylint: disable=keyword-arg-before-vararg
args[0].return_value.search_endpoints.return_value = [
munch.Munch(url=self._neutron_url)]
args[0].return_value.search_services.return_value = [
mock>=2.0.0 # BSD
nose>=1.3.7 # LGPL
flake8<2.6.0,>=2.5.4 # MIT
-pylint==1.4.5 # GPLv2
+pylint # GPLv2
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
sphinx-opnfv-theme
sphinx-rtd-theme
functest.utils.functest_utils
commands =
bash -c "\
- pylint -f parseable --ignore-imports=y --disable=locally-disabled functest | \
- tee pylint.out | sed -ne '/Raw metrics/,//p'"
+ pylint -f parseable \
+ --ignore-imports=y \
+ --disable=locally-disabled functest | tee pylint.out"
pylint --reports=n --errors-only functest
pylint --disable=locally-disabled \
--disable=duplicate-code \