Ensure string types (#42362)

* actually enforce string types

* unquote after its text

* fixed incorrect template type

* fixing string showed error in template typing
This commit is contained in:
Brian Coca 2018-07-10 09:41:33 -04:00 committed by GitHub
parent 381263ad99
commit 4a7940c562
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View file

@ -89,7 +89,7 @@ class ActionModule(ActionBase):
for b_type in ('force', 'follow', 'trim_blocks'):
value = locals()[b_type]
value = ensure_type(value, 'string')
value = ensure_type(value, 'boolean')
if value is not None and not isinstance(value, bool):
raise AnsibleActionFail("%s is expected to be a boolean, but got %s instead" % (b_type, type(value)))
locals()[b_type] = value