diff --git a/fuelweb_test/helpers/checkers.py b/fuelweb_test/helpers/checkers.py index 90cd57c5e..cc5254b1f 100644 --- a/fuelweb_test/helpers/checkers.py +++ b/fuelweb_test/helpers/checkers.py @@ -508,7 +508,7 @@ def check_stats_on_collector(collector_remote, postgres_actions, master_uuid): # Check that important data (clusters number, nodes number, nodes roles, # user's email, used operation system, OpenStack stats) is saved correctly - for stat_type in general_stats.keys(): + for stat_type in general_stats: assert_true( isinstance(summ_stats[stat_type], general_stats[stat_type]), "Installation structure in Collector's DB doesn't contain" @@ -568,7 +568,7 @@ def check_stats_private_info(collector_remote, postgres_actions, _has_private_data = False # Check that stats doesn't contain private data (e.g. # specific passwords, settings, emails) - for _private in private_data.keys(): + for _private in private_data: _regex = r'(?P"\S+"): (?P[^:]*"{0}"[^:]*)'.format( private_data[_private]) for _match in re.finditer(_regex, data): @@ -584,7 +584,7 @@ def check_stats_private_info(collector_remote, postgres_actions, _has_private_data = True # Check that stats doesn't contain private types of data (e.g. any kind # of passwords) - for _data_type in secret_data_types.keys(): + for _data_type in secret_data_types: _regex = (r'(?P"[^"]*{0}[^"]*": (\{{[^\}}]+\}}|\[[^\]+]\]|' r'"[^"]+"))').format(secret_data_types[_data_type]) diff --git a/fuelweb_test/helpers/patching.py b/fuelweb_test/helpers/patching.py index bc8e3e585..62e7b2b6b 100644 --- a/fuelweb_test/helpers/patching.py +++ b/fuelweb_test/helpers/patching.py @@ -396,7 +396,7 @@ def get_slaves_ids_by_role(slaves, role=None): def verify_fix_apply_step(apply_step): validation_schema = patching_validation_schema - for key in validation_schema.keys(): + for key in validation_schema: if key in apply_step.keys(): is_exists = apply_step[key] is not None else: diff --git a/fuelweb_test/testrail/generate_failure_group_statistics.py b/fuelweb_test/testrail/generate_failure_group_statistics.py index 451d42394..57cf710b0 100644 --- a/fuelweb_test/testrail/generate_failure_group_statistics.py +++ b/fuelweb_test/testrail/generate_failure_group_statistics.py @@ -440,7 +440,8 @@ def get_global_failure_group_list( failure_group_dict[key] = [] failure_group_dict[key].append(failure) # let's find Levenshtein distance and update failure_group_dict - for num1, key1 in enumerate(failure_group_dict.keys()): + for num1, key1 in enumerate(failure_group_dict): + # pylint: disable=C0201 for key2 in failure_group_dict.keys()[num1 + 1:]: # let's skip grouping if len are different more 10% if key1 == key2 or abs(float(len(key1) / len(key2))) >\ diff --git a/fuelweb_test/testrail/report.py b/fuelweb_test/testrail/report.py index f3142f721..90a075b5d 100755 --- a/fuelweb_test/testrail/report.py +++ b/fuelweb_test/testrail/report.py @@ -73,7 +73,7 @@ class TestResult(object): @property def status(self): - for s in self.available_statuses.keys(): + for s in self.available_statuses: if self._status in self.available_statuses[s]: return s logger.error('Unsupported result status: "{0}"!'.format(self._status))