|
|
@ -46,14 +46,20 @@ class ActionModule(ActionBase):
|
|
|
|
fail_msg = self._task.args.get('fail_msg', self._task.args.get('msg'))
|
|
|
|
fail_msg = self._task.args.get('fail_msg', self._task.args.get('msg'))
|
|
|
|
if fail_msg is None:
|
|
|
|
if fail_msg is None:
|
|
|
|
fail_msg = 'Assertion failed'
|
|
|
|
fail_msg = 'Assertion failed'
|
|
|
|
elif not isinstance(fail_msg, string_types):
|
|
|
|
elif isinstance(fail_msg, list):
|
|
|
|
raise AnsibleError('Incorrect type for fail_msg or msg, expected string and got %s' % type(fail_msg))
|
|
|
|
if not all(isinstance(x, string_types) for x in fail_msg):
|
|
|
|
|
|
|
|
raise AnsibleError('Type of one of the elements in fail_msg or msg list is not string type')
|
|
|
|
|
|
|
|
elif not isinstance(fail_msg, (string_types, list)):
|
|
|
|
|
|
|
|
raise AnsibleError('Incorrect type for fail_msg or msg, expected a string or list and got %s' % type(fail_msg))
|
|
|
|
|
|
|
|
|
|
|
|
success_msg = self._task.args.get('success_msg')
|
|
|
|
success_msg = self._task.args.get('success_msg')
|
|
|
|
if success_msg is None:
|
|
|
|
if success_msg is None:
|
|
|
|
success_msg = 'All assertions passed'
|
|
|
|
success_msg = 'All assertions passed'
|
|
|
|
elif not isinstance(success_msg, string_types):
|
|
|
|
elif isinstance(success_msg, list):
|
|
|
|
raise AnsibleError('Incorrect type for success_msg, expected string and got %s' % type(success_msg))
|
|
|
|
if not all(isinstance(x, string_types) for x in success_msg):
|
|
|
|
|
|
|
|
raise AnsibleError('Type of one of the elements in success_msg list is not string type')
|
|
|
|
|
|
|
|
elif not isinstance(success_msg, (string_types, list)):
|
|
|
|
|
|
|
|
raise AnsibleError('Incorrect type for success_msg, expected a string or list and got %s' % type(success_msg))
|
|
|
|
|
|
|
|
|
|
|
|
quiet = boolean(self._task.args.get('quiet', False), strict=False)
|
|
|
|
quiet = boolean(self._task.args.get('quiet', False), strict=False)
|
|
|
|
|
|
|
|
|
|
|
|