Ad-hoc command: fix 'any' call in play_ds (#49852)

* Ad-hoc command: fix 'any' call in play_ds
* Unit test for ad-hoc cli
* Review comments

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
This commit is contained in:
Abhijeet Kasurde 2018-12-16 11:07:06 +05:30 committed by GitHub
commit 162d9497ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 93 additions and 1 deletions

View file

@ -80,7 +80,7 @@ class AdHocCLI(CLI):
mytask = {'action': {'module': self.options.module_name, 'args': parse_kv(self.options.module_args, check_raw=check_raw)}}
# avoid adding to tasks that don't support it, unless set, then give user an error
if self.options.module_name not in ('include_role', 'include_tasks') or any(async_val, poll):
if self.options.module_name not in ('include_role', 'include_tasks') or any(frozenset((async_val, poll))):
mytask['async_val'] = async_val
mytask['poll'] = poll