Skip to content

Commit

Permalink
Added +1 to the end in random filter so that it was inclusive (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
zerkms authored and maxamillion committed Jan 26, 2018
1 parent 101e983 commit ea2b89c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ansible/plugins/filter/core.py
Expand Up @@ -235,7 +235,7 @@ def rand(environment, end, start=None, step=None, seed=None):
start = 0
if not step:
step = 1
return r.randrange(start, end, step)
return r.randrange(start, end + 1, step)
elif hasattr(end, '__iter__'):
if start or step:
raise AnsibleFilterError('start and step can only be used with integer values')
Expand Down

0 comments on commit ea2b89c

Please sign in to comment.