diff options
author | Richard Elias <richardx.elias@intel.com> | 2018-02-28 16:16:31 +0000 |
---|---|---|
committer | Richard Elias <richardx.elias@intel.com> | 2018-03-23 14:24:03 +0000 |
commit | 184b72f6b706036aeda88d52ecb0e0c27b1573fe (patch) | |
tree | 04e0762dd89f26f55aa11a345f2b4ff02cb96aef /conf | |
parent | 82a17a3d7c59a49105d6f3b2e4044ab19f77b0a0 (diff) |
python: Pylint 1.8.2 code conformity
Updated master Python scripts to conform to the newer pylint
1.8.2 standard.
JIRA: VSPERF-563
Change-Id: I19305a008a2e22c2f4841aa83fed85fbdc2d549c
Signed-off-by: Richard Elias <richardx.elias@intel.com>
Reviewed-by: Martin Klozik <martinx.klozik@intel.com>
Reviewed-by: Al Morton <acmorton@att.com>
Reviewed-by: Christian Trautman <ctrautma@redhat.com>
Reviewed-by: Sridhar Rao <sridhar.rao@spirent.com>
Diffstat (limited to 'conf')
-rw-r--r-- | conf/__init__.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/conf/__init__.py b/conf/__init__.py index d5d26757..83c5475f 100644 --- a/conf/__init__.py +++ b/conf/__init__.py @@ -70,7 +70,7 @@ class Settings(object): except AttributeError: pass return param - elif isinstance(param, list) or isinstance(param, tuple): + elif isinstance(param, (list, tuple)): tmp_list = [] for item in param: tmp_list.append(self._eval_param(item)) @@ -229,7 +229,7 @@ class Settings(object): if key not in self.__dict__ and key not in _EXTRA_TEST_PARAMS: unknown_keys.append(key) - if len(unknown_keys): + if unknown_keys: raise RuntimeError('Test parameters contain unknown configuration ' 'parameter(s): {}'.format(', '.join(unknown_keys))) @@ -270,7 +270,7 @@ class Settings(object): for vmindex in range(vm_number): value = master_value_str.replace('#VMINDEX', str(vmindex)) for macro, args, param, _, step in re.findall(_PARSE_PATTERN, value): - multi = int(step) if len(step) and int(step) else 1 + multi = int(step) if step and int(step) else 1 if macro == '#EVAL': # pylint: disable=eval-used tmp_result = str(eval(param)) @@ -325,13 +325,13 @@ class Settings(object): assert result == self.getValue(attr) return True - def validate_setValue(self, dummy_result, name, value): + def validate_setValue(self, _dummy_result, name, value): """Verifies, that value was correctly set """ assert value == self.__dict__[name] return True - def validate_resetValue(self, dummy_result, attr): + def validate_resetValue(self, _dummy_result, attr): """Verifies, that value was correctly reset """ return 'TEST_PARAMS' not in self.__dict__ or \ |