diff options
author | Jo¶rgen Karlsson <jorgen.w.karlsson@ericsson.com> | 2016-01-13 16:19:58 +0100 |
---|---|---|
committer | Jo¶rgen Karlsson <jorgen.w.karlsson@ericsson.com> | 2016-01-13 17:27:17 +0100 |
commit | 791323df72d8bf4f4f4c32a1e7273721f2adc349 (patch) | |
tree | bdac6e82f26150f153be3ed0f699b60e62094a5d | |
parent | 5c4c8667e0c0a8e039d7682f235b022f39149d56 (diff) |
Fix flake8 errors
Change-Id: I14f21092f5e97abf0629a92a27062846a6d3130b
JIRA:-
Signed-off-by: Jo¶rgen Karlsson <jorgen.w.karlsson@ericsson.com>
-rw-r--r-- | yardstick/__init__.py | 14 | ||||
-rwxr-xr-x | yardstick/benchmark/runners/arithmetic.py | 3 | ||||
-rwxr-xr-x | yardstick/benchmark/runners/base.py | 4 | ||||
-rw-r--r-- | yardstick/benchmark/scenarios/networking/ping.py | 4 | ||||
-rw-r--r-- | yardstick/benchmark/scenarios/networking/ping6.py | 4 | ||||
-rw-r--r-- | yardstick/cmd/cli.py | 5 | ||||
-rw-r--r-- | yardstick/common/template_format.py | 6 | ||||
-rw-r--r-- | yardstick/vTC/apexlake/experimental_framework/heat_manager.py | 5 | ||||
-rw-r--r-- | yardstick/vTC/apexlake/tests/benchmarking_unit_test.py | 5 | ||||
-rw-r--r-- | yardstick/vTC/apexlake/tests/common_test.py | 4 | ||||
-rw-r--r-- | yardstick/vTC/apexlake/tests/conf_file_sections_test.py | 5 | ||||
-rw-r--r-- | yardstick/vTC/apexlake/tests/deployment_unit_test.py | 5 | ||||
-rw-r--r-- | yardstick/vTC/apexlake/tests/generates_template_test.py | 5 | ||||
-rw-r--r-- | yardstick/vTC/apexlake/tests/heat_manager_test.py | 5 | ||||
-rw-r--r-- | yardstick/vTC/apexlake/tests/multi_tenancy_throughput_benchmark_test.py | 5 | ||||
-rw-r--r-- | yardstick/vTC/apexlake/tests/tree_node_test.py | 5 |
16 files changed, 39 insertions, 45 deletions
diff --git a/yardstick/__init__.py b/yardstick/__init__.py index 7114f8008..c31948d43 100644 --- a/yardstick/__init__.py +++ b/yardstick/__init__.py @@ -9,6 +9,13 @@ import logging import logging.config +import sys +import os +import yardstick.vTC.apexlake as apexlake + +# Hack to be able to run apexlake unit tests +# without having to install apexlake. +sys.path.append(os.path.dirname(apexlake.__file__)) logging.basicConfig( level=logging.WARNING, @@ -16,10 +23,3 @@ logging.basicConfig( '%(levelname)s %(message)s', # noqa datefmt='%m/%d/%y %H:%M:%S') logging.getLogger(__name__).setLevel(logging.INFO) - -# Hack to be able to run apexlake unit tests -# without having to install apexlake. -import sys -import os -import yardstick.vTC.apexlake as apexlake -sys.path.append(os.path.dirname(apexlake.__file__)) diff --git a/yardstick/benchmark/runners/arithmetic.py b/yardstick/benchmark/runners/arithmetic.py index 7e516ea1e..035f9e295 100755 --- a/yardstick/benchmark/runners/arithmetic.py +++ b/yardstick/benchmark/runners/arithmetic.py @@ -58,7 +58,8 @@ def _worker_process(queue, cls, method_name, scenario_cfg, sla_action = scenario_cfg["sla"].get("action", "assert") # To both be able to include the stop value and handle backwards stepping - margin = lambda start, stop: -1 if start > stop else 1 + def margin(start, stop): + return -1 if start > stop else 1 param_iters = \ [xrange(d['start'], d['stop'] + margin(d['start'], d['stop']), diff --git a/yardstick/benchmark/runners/base.py b/yardstick/benchmark/runners/base.py index 9925ace2f..56a394e1c 100755 --- a/yardstick/benchmark/runners/base.py +++ b/yardstick/benchmark/runners/base.py @@ -14,14 +14,14 @@ import subprocess import time import traceback -log = logging.getLogger(__name__) - from oslo_config import cfg import yardstick.common.utils as utils from yardstick.benchmark.scenarios import base as base_scenario from yardstick.dispatcher.base import Base as DispatcherBase +log = logging.getLogger(__name__) + CONF = cfg.CONF diff --git a/yardstick/benchmark/scenarios/networking/ping.py b/yardstick/benchmark/scenarios/networking/ping.py index c62c79e54..fc4176650 100644 --- a/yardstick/benchmark/scenarios/networking/ping.py +++ b/yardstick/benchmark/scenarios/networking/ping.py @@ -72,8 +72,8 @@ class Ping(base.Scenario): if "sla" in self.scenario_cfg: sla_max_rtt = int(self.scenario_cfg["sla"]["max_rtt"]) - assert result["rtt"] <= sla_max_rtt, "rtt %f > sla:max_rtt(%f); " % \ - (result["rtt"], sla_max_rtt) + assert result["rtt"] <= sla_max_rtt, \ + "rtt %f > sla:max_rtt(%f); " % (result["rtt"], sla_max_rtt) else: LOG.error("ping '%s' '%s' timeout", options, destination) diff --git a/yardstick/benchmark/scenarios/networking/ping6.py b/yardstick/benchmark/scenarios/networking/ping6.py index 629f62be5..5d878eb8f 100644 --- a/yardstick/benchmark/scenarios/networking/ping6.py +++ b/yardstick/benchmark/scenarios/networking/ping6.py @@ -90,8 +90,8 @@ class Ping6(base.Scenario): # pragma: no cover if "sla" in self.scenario_cfg: sla_max_rtt = int(self.scenario_cfg["sla"]["max_rtt"]) - assert result["rtt"] <= sla_max_rtt, "rtt %f > sla:max_rtt(%f); " % \ - (result["rtt"], sla_max_rtt) + assert result["rtt"] <= sla_max_rtt, \ + "rtt %f > sla:max_rtt(%f); " % (result["rtt"], sla_max_rtt) else: LOG.error("ping6 timeout") self.run_done = True diff --git a/yardstick/cmd/cli.py b/yardstick/cmd/cli.py index 1f058a5a1..8d75d7d5e 100644 --- a/yardstick/cmd/cli.py +++ b/yardstick/cmd/cli.py @@ -101,8 +101,9 @@ class YardstickCLI(): '''run the command line interface''' # register subcommands to parse additional command line arguments - parser = lambda subparsers: self._add_command_parsers( - YardstickCLI.categories, subparsers) + def parser(subparsers): + self._add_command_parsers(YardstickCLI.categories, subparsers) + category_opt = cfg.SubCommandOpt("category", title="Command categories", help="Available categories", diff --git a/yardstick/common/template_format.py b/yardstick/common/template_format.py index 881b7e45b..2deaf393c 100644 --- a/yardstick/common/template_format.py +++ b/yardstick/common/template_format.py @@ -56,8 +56,8 @@ def parse(tmpl_str): if tpl is None: tpl = {} # Looking for supported version keys in the loaded template - if not ('HeatTemplateFormatVersion' in tpl - or 'heat_template_version' in tpl - or 'AWSTemplateFormatVersion' in tpl): + if not ('HeatTemplateFormatVersion' in tpl or + 'heat_template_version' in tpl or + 'AWSTemplateFormatVersion' in tpl): raise ValueError("Template format version not found.") return tpl diff --git a/yardstick/vTC/apexlake/experimental_framework/heat_manager.py b/yardstick/vTC/apexlake/experimental_framework/heat_manager.py index 607fa77f3..28c069f6c 100644 --- a/yardstick/vTC/apexlake/experimental_framework/heat_manager.py +++ b/yardstick/vTC/apexlake/experimental_framework/heat_manager.py @@ -12,15 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -__author__ = 'vmriccox' - - from keystoneclient.v2_0 import client as keystoneClient from heatclient import client as heatClient from heatclient.common import template_utils import experimental_framework.common as common +__author__ = 'vmriccox' + class HeatManager: diff --git a/yardstick/vTC/apexlake/tests/benchmarking_unit_test.py b/yardstick/vTC/apexlake/tests/benchmarking_unit_test.py index ccf64066a..652327aab 100644 --- a/yardstick/vTC/apexlake/tests/benchmarking_unit_test.py +++ b/yardstick/vTC/apexlake/tests/benchmarking_unit_test.py @@ -12,9 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__author__ = 'vmriccox' - - import unittest import mock from experimental_framework.benchmarking_unit import BenchmarkingUnit @@ -24,6 +21,8 @@ import experimental_framework.common as common from experimental_framework.benchmarks.rfc2544_throughput_benchmark import \ RFC2544ThroughputBenchmark +__author__ = 'vmriccox' + # class DummyDataManager(DataManager): # diff --git a/yardstick/vTC/apexlake/tests/common_test.py b/yardstick/vTC/apexlake/tests/common_test.py index 293754b16..19b2a0ea2 100644 --- a/yardstick/vTC/apexlake/tests/common_test.py +++ b/yardstick/vTC/apexlake/tests/common_test.py @@ -1,5 +1,3 @@ -__author__ = 'vmricco' - import unittest import mock import os @@ -8,6 +6,8 @@ import ConfigParser import experimental_framework.common as common import experimental_framework.constants.conf_file_sections as cf +__author__ = 'vmricco' + def reset_common(): common.LOG = None diff --git a/yardstick/vTC/apexlake/tests/conf_file_sections_test.py b/yardstick/vTC/apexlake/tests/conf_file_sections_test.py index d2157fcce..3266ce6b7 100644 --- a/yardstick/vTC/apexlake/tests/conf_file_sections_test.py +++ b/yardstick/vTC/apexlake/tests/conf_file_sections_test.py @@ -12,12 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -__author__ = 'vmriccox' - - import unittest from experimental_framework.constants import conf_file_sections as cfs +__author__ = 'vmriccox' + class TestConfFileSection(unittest.TestCase): diff --git a/yardstick/vTC/apexlake/tests/deployment_unit_test.py b/yardstick/vTC/apexlake/tests/deployment_unit_test.py index 46b32837b..81171670c 100644 --- a/yardstick/vTC/apexlake/tests/deployment_unit_test.py +++ b/yardstick/vTC/apexlake/tests/deployment_unit_test.py @@ -12,13 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -__author__ = 'vmriccox' - - import unittest import mock import experimental_framework.deployment_unit as mut +__author__ = 'vmriccox' + class DummyHeatManager: diff --git a/yardstick/vTC/apexlake/tests/generates_template_test.py b/yardstick/vTC/apexlake/tests/generates_template_test.py index f4525a23d..dad3177d6 100644 --- a/yardstick/vTC/apexlake/tests/generates_template_test.py +++ b/yardstick/vTC/apexlake/tests/generates_template_test.py @@ -12,15 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -__author__ = 'gpetralx' - - import unittest import experimental_framework.heat_template_generation as heat_gen import mock import os import experimental_framework.common as common +__author__ = 'gpetralx' + def reset_common(): common.LOG = None diff --git a/yardstick/vTC/apexlake/tests/heat_manager_test.py b/yardstick/vTC/apexlake/tests/heat_manager_test.py index a2798a737..f1d3d0028 100644 --- a/yardstick/vTC/apexlake/tests/heat_manager_test.py +++ b/yardstick/vTC/apexlake/tests/heat_manager_test.py @@ -12,13 +12,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -__author__ = 'gpetralx' - - import unittest from experimental_framework import heat_manager import mock +__author__ = 'gpetralx' + def get_mock_heat(version, *args, **kwargs): return MockHeat() diff --git a/yardstick/vTC/apexlake/tests/multi_tenancy_throughput_benchmark_test.py b/yardstick/vTC/apexlake/tests/multi_tenancy_throughput_benchmark_test.py index babf04ab1..6544fea43 100644 --- a/yardstick/vTC/apexlake/tests/multi_tenancy_throughput_benchmark_test.py +++ b/yardstick/vTC/apexlake/tests/multi_tenancy_throughput_benchmark_test.py @@ -12,9 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -__author__ = 'gpetralx' - - import unittest import mock import os @@ -22,6 +19,8 @@ import experimental_framework.common as common from experimental_framework.benchmarks \ import multi_tenancy_throughput_benchmark as bench +__author__ = 'gpetralx' + class MockDeploymentUnit(object): def deploy_heat_template(self, temp_file, stack_name, heat_param): diff --git a/yardstick/vTC/apexlake/tests/tree_node_test.py b/yardstick/vTC/apexlake/tests/tree_node_test.py index 8b302c912..e51343f0e 100644 --- a/yardstick/vTC/apexlake/tests/tree_node_test.py +++ b/yardstick/vTC/apexlake/tests/tree_node_test.py @@ -12,12 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -__author__ = 'gpetralx' - - import unittest import experimental_framework.heat_template_generation as heat_gen +__author__ = 'gpetralx' + class TestTreeNode(unittest.TestCase): def setUp(self): |