mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
Revert range change (#50155)
* Revert "Fix incorrect examples with random filter (#50137)" This reverts commit9a7dbd5213. The correction is incomplete and also based on a 'fix' that was supposed to have been reverted already * Revert "Added `+1` to the `end` in `random` filter so that it was inclusive (#27215)" This reverts commitea2b89c7ae. reverted fix as agreed at the time, but missed by maintainers.
This commit is contained in:
@@ -213,7 +213,7 @@ def rand(environment, end, start=None, step=None, seed=None):
|
||||
start = 0
|
||||
if not step:
|
||||
step = 1
|
||||
return r.randrange(start, end + 1, step)
|
||||
return r.randrange(start, end, step)
|
||||
elif hasattr(end, '__iter__'):
|
||||
if start or step:
|
||||
raise AnsibleFilterError('start and step can only be used with integer values')
|
||||
|
||||
Reference in New Issue
Block a user