Merge "Replace six iteration methods with standard ones"

This commit is contained in:
Jenkins 2016-12-08 02:25:04 +00:00 committed by Gerrit Code Review
commit 9a8b0d6f0a
4 changed files with 5 additions and 8 deletions

View File

@ -55,7 +55,7 @@ class TokenSanitizer(object):
:return: Sanitized object
"""
if isinstance(obj, dict):
return dict([self.sanitize(item) for item in six.iteritems(obj)])
return dict([self.sanitize(item) for item in obj.items()])
elif isinstance(obj, list):
return [self.sanitize(item) for item in obj]
elif isinstance(obj, tuple):

View File

@ -67,7 +67,7 @@ def bind(obj, mappings):
return [bind(t, mappings) for t in obj]
elif isinstance(obj, collections.Mapping):
result = {}
for key, value in six.iteritems(obj):
for key, value in obj.items():
result[bind(key, mappings)] = bind(value, mappings)
return result
elif isinstance(obj, six.string_types) and obj.startswith('$'):

View File

@ -13,8 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import six
from murano.dsl import helpers
@ -101,7 +99,7 @@ class CongressRulesManager(object):
for v in obj:
self._walk(v, new_owner, path)
elif isinstance(obj, dict):
for key, value in six.iteritems(obj):
for key, value in obj.items():
self._walk(value, new_owner, path + (key, ))
def _process_item(self, obj, owner_id, path):
@ -152,7 +150,7 @@ class CongressRulesManager(object):
prefix.split('.')[0]))
return rules
for key, value in six.iteritems(obj):
for key, value in obj.items():
if key == '?':
continue

View File

@ -18,7 +18,6 @@ Default actions reside in this module.
These action are available out of the box for Murano users.
"""
import six
import yaql.language.utils as utils
import murano.dsl.exceptions as exceptions
@ -42,7 +41,7 @@ class ActionUtils(object):
for item in obj:
self._get_objects_by_id(item, objects)
elif isinstance(obj, utils.FrozenDict):
for k, v in six.iteritems(obj):
for k, v in obj.items():
self._get_objects_by_id(k, objects)
self._get_objects_by_id(v, objects)
return objects