mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Don't call .keys()
on dictionaries
This commit is contained in:
parent
97ced3a5ba
commit
9a31be7271
1 changed files with 4 additions and 4 deletions
|
@ -10,7 +10,6 @@ import collections
|
|||
# Import third party libs
|
||||
import copy
|
||||
import os
|
||||
import copy
|
||||
import logging
|
||||
import yaml
|
||||
import salt.ext.six as six
|
||||
|
@ -154,7 +153,7 @@ def get(key,
|
|||
'skipped.', default, ret, type(ret).__name__
|
||||
)
|
||||
elif isinstance(default, list):
|
||||
ret = salt.utils.traverse_dict_and_list(
|
||||
ret = salt.utils.traverse_dict_and_list( # pylint: disable=redefined-variable-type
|
||||
pillar_dict,
|
||||
key,
|
||||
[],
|
||||
|
@ -273,6 +272,7 @@ def items(*args, **kwargs):
|
|||
|
||||
return pillar.compile_pillar()
|
||||
|
||||
|
||||
# Allow pillar.data to also be used to return pillar data
|
||||
data = salt.utils.alias_function(items, 'data')
|
||||
|
||||
|
@ -340,7 +340,7 @@ def ls(*args):
|
|||
salt '*' pillar.ls
|
||||
'''
|
||||
|
||||
return list(items(*args).keys())
|
||||
return list(items(*args))
|
||||
|
||||
|
||||
def item(*args, **kwargs):
|
||||
|
@ -538,7 +538,7 @@ def keys(key, delimiter=DEFAULT_TARGET_DELIM):
|
|||
if not isinstance(ret, dict):
|
||||
raise ValueError("Pillar value in key {0} is not a dict".format(key))
|
||||
|
||||
return ret.keys()
|
||||
return list(ret)
|
||||
|
||||
|
||||
def file_exists(path, saltenv=None):
|
||||
|
|
Loading…
Add table
Reference in a new issue