|
6 | 6 | This module primarily processes and properly format
|
7 | 7 | the data outputted by a module to serve it to another module.
|
8 | 8 | """
|
9 |
| -from __future__ import absolute_import |
| 9 | + |
10 | 10 |
|
11 | 11 | import logging
|
12 | 12 | import re
|
@@ -72,9 +72,9 @@ def _filter_dict(dct,
|
72 | 72 | not equal to 2.
|
73 | 73 | """
|
74 | 74 | ret = dct
|
75 |
| - for comp, value in filter_rules.iteritems(): |
| 75 | + for comp, value in filter_rules.items(): |
76 | 76 | try:
|
77 |
| - ret = {key: val for key, val in ret.iteritems() |
| 77 | + ret = {key: val for key, val in ret.items() |
78 | 78 | if (filter_values and _compare(comp, val, value)) or
|
79 | 79 | (not filter_values and _compare(comp, key, value))}
|
80 | 80 | except ArgumentValueError:
|
@@ -174,7 +174,7 @@ def _filter(seq,
|
174 | 174 | LOG.error("``filter_rules`` should be of type dict")
|
175 | 175 | return None
|
176 | 176 | ret = seq
|
177 |
| - for comp, value in filter_rules.iteritems(): |
| 177 | + for comp, value in filter_rules.items(): |
178 | 178 | try:
|
179 | 179 | ret = [x for x in ret if _compare(comp, x, value)]
|
180 | 180 | except ArgumentValueError:
|
@@ -428,7 +428,7 @@ def dict_to_list(starting_dict=None, update_chained=True, chained=None, chained_
|
428 | 428 | except (AttributeError, ValueError, TypeError):
|
429 | 429 | LOG.error("Invalid arguments type.", exc_info=True)
|
430 | 430 | return False, None
|
431 |
| - ret = [(key, value) for key, value in chained.iteritems()] |
| 431 | + ret = [(key, value) for key, value in chained.items()] |
432 | 432 | status = bool(ret)
|
433 | 433 |
|
434 | 434 | return status, ret
|
@@ -482,7 +482,7 @@ def _dict_convert_none(dictionary):
|
482 | 482 | LOG.error("Invalid argument type - should be dict")
|
483 | 483 | return None
|
484 | 484 | updated_dict = {}
|
485 |
| - for key, value in dictionary.iteritems(): |
| 485 | + for key, value in dictionary.items(): |
486 | 486 | if value == '':
|
487 | 487 | updated_dict[key] = None
|
488 | 488 | elif isinstance(value, dict):
|
@@ -594,7 +594,7 @@ def _sterilize_dict(dictionary):
|
594 | 594 | LOG.error("Invalid argument type - should be dict")
|
595 | 595 | return None
|
596 | 596 | updated_dict = {}
|
597 |
| - for key, value in dictionary.iteritems(): |
| 597 | + for key, value in dictionary.items(): |
598 | 598 | if isinstance(value, dict):
|
599 | 599 | updated_dict[key] = _sterilize_dict(value)
|
600 | 600 | elif isinstance(value, (set, list, tuple)):
|
|
0 commit comments