mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #39361 from gtmanfred/2016.11
make sure both variables are strings.
This commit is contained in:
commit
a3a9a8e1ed
1 changed files with 3 additions and 3 deletions
|
@ -561,9 +561,9 @@ def filter_by(lookup_dict, grain='os_family', merge=None, default='default', bas
|
|||
# Iterate over the list of grain values to match against patterns in the lookup_dict keys
|
||||
for each in val if isinstance(val, list) else [val]:
|
||||
for key in sorted(lookup_dict):
|
||||
if key not in six.string_types:
|
||||
key = str(key)
|
||||
if fnmatch.fnmatchcase(each, key):
|
||||
test_key = key if isinstance(key, six.string_types) else str(key)
|
||||
test_each = each if isinstance(each, six.string_types) else str(each)
|
||||
if fnmatch.fnmatchcase(test_each, test_key):
|
||||
ret = lookup_dict[key]
|
||||
break
|
||||
if ret is not None:
|
||||
|
|
Loading…
Add table
Reference in a new issue