Bail out if an action is not a string

Since YAML allows anything, we should enforce that actions are strings.

This closes #1419.
pull/1648/head
Dag Wieers 12 years ago
parent 75d3b77454
commit dfa1e8b0dc

@ -127,6 +127,10 @@ class Task(object):
self.ignore_errors = ds.get('ignore_errors', False) self.ignore_errors = ds.get('ignore_errors', False)
# action should be a string
if not isinstance(self.action, basestring):
raise errors.AnsibleError("action is of type '%s' and not a string in task. name: %s" % (type(self.action).__name__, self.name))
# notify can be a string or a list, store as a list # notify can be a string or a list, store as a list
if isinstance(self.notify, basestring): if isinstance(self.notify, basestring):
self.notify = [ self.notify ] self.notify = [ self.notify ]

Loading…
Cancel
Save