raiseAnsibleParserError("The field '%s' is supposed to be a string type, however the incoming data structure is a %s"%(name,type(value)),obj=self.get_ds())
raiseAnsibleParserError("The field '%s' is supposed to be a string type,"
" however the incoming data structure is a %s"%(name,type(value)),obj=self.get_ds())
defcopy(self):
'''
@ -336,7 +331,8 @@ class Base:
ifattribute.listofisnotNone:
foriteminvalue:
ifnotisinstance(item,attribute.listof):
raiseAnsibleParserError("the field '%s' should be a list of %s, but the item '%s' is a %s"%(name,attribute.listof,item,type(item)),obj=self.get_ds())
raiseAnsibleParserError("the field '%s' should be a list of %s,"
" but the item '%s' is a %s"%(name,attribute.listof,item,type(item)),obj=self.get_ds())
raiseAnsibleParserError("the field '%s' is required, and cannot have empty values"%(name,),obj=self.get_ds())
@ -358,10 +354,12 @@ class Base:
setattr(self,name,value)
except(TypeError,ValueError)ase:
raiseAnsibleParserError("the field '%s' has an invalid value (%s), and could not be converted to an %s. Error was: %s"%(name,value,attribute.isa,e),obj=self.get_ds())
raiseAnsibleParserError("the field '%s' has an invalid value (%s), and could not be converted to an %s."
raiseAnsibleParserError("the field '%s' has an invalid value, which appears to include a variable that is undefined. The error was: %s"%(name,e),obj=self.get_ds())
raiseAnsibleParserError("the field '%s' has an invalid value, which appears to include a variable that is undefined."
@ -37,8 +36,6 @@ from ansible.playbook.conditional import Conditional
fromansible.playbook.roleimportRole
fromansible.playbook.taggableimportTaggable
__all__=['Task']
try:
from__main__importdisplay
display=display
@ -46,6 +43,9 @@ except ImportError:
fromansible.utils.displayimportDisplay
display=Display()
__all__=['Task']
classTask(Base,Conditional,Taggable,Become):
"""
@ -174,7 +174,8 @@ class Task(Base, Conditional, Taggable, Become):
ifactionin('command','shell','script'):
if'cmd'inargs:
ifargs.get('_raw_params','')!='':
raiseAnsibleError("The 'cmd' argument cannot be used when other raw parameters are specified. Please put everything in one or the other place.",obj=ds)
raiseAnsibleError("The 'cmd' argument cannot be used when other raw parameters are specified."
" Please put everything in one or the other place.",obj=ds)
args['_raw_params']=args.pop('cmd')
new_ds['action']=action
@ -204,7 +205,9 @@ class Task(Base, Conditional, Taggable, Become):
# here, and show a deprecation message as we will remove this at
self._display.deprecated("Specifying include variables at the top-level of the task is deprecated. Please see:\nhttp://docs.ansible.com/ansible/playbooks_roles.html#task-include-files-and-encouraging-reuse\n\nfor currently supported syntax regarding included files and variables")
display.deprecated("Specifying include variables at the top-level of the task is deprecated."
self._display.deprecated("Using bare variables for environment is deprecated. Update your playbooks so that the environment value uses the full variable syntax ('{{foo}}')")
display.deprecated("Using bare variables for environment is deprecated."
" Update your playbooks so that the environment value uses the full variable syntax ('{{foo}}')")
break
returntemplar.template(value,convert_bare=True)
@ -387,4 +391,3 @@ class Task(Base, Conditional, Taggable, Become):