mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
tried to ensure input is always a list but will now be a noop for non
listable items
This commit is contained in:
@@ -236,7 +236,10 @@ def rand(environment, end, start=None, step=None):
|
|||||||
raise errors.AnsibleFilterError('random can only be used on sequences and integers')
|
raise errors.AnsibleFilterError('random can only be used on sequences and integers')
|
||||||
|
|
||||||
def randomize_list(mylist):
|
def randomize_list(mylist):
|
||||||
shuffle(mylist)
|
try:
|
||||||
|
shuffle(list(mylist))
|
||||||
|
except:
|
||||||
|
pass
|
||||||
return mylist
|
return mylist
|
||||||
|
|
||||||
class FilterModule(object):
|
class FilterModule(object):
|
||||||
|
|||||||
Reference in New Issue
Block a user