mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 22:50:19 -07:00
Added +1
to the end
in random
filter so that it was inclusive (#27215)
This commit is contained in:
parent
101e983f07
commit
ea2b89c7ae
1 changed files with 1 additions and 1 deletions
|
@ -235,7 +235,7 @@ def rand(environment, end, start=None, step=None, seed=None):
|
||||||
start = 0
|
start = 0
|
||||||
if not step:
|
if not step:
|
||||||
step = 1
|
step = 1
|
||||||
return r.randrange(start, end, step)
|
return r.randrange(start, end + 1, step)
|
||||||
elif hasattr(end, '__iter__'):
|
elif hasattr(end, '__iter__'):
|
||||||
if start or step:
|
if start or step:
|
||||||
raise AnsibleFilterError('start and step can only be used with integer values')
|
raise AnsibleFilterError('start and step can only be used with integer values')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue