|
|
@ -61,7 +61,8 @@ class Task(Base):
|
|
|
|
# FIXME: this should not be a Task
|
|
|
|
# FIXME: this should not be a Task
|
|
|
|
meta = FieldAttribute(isa='string')
|
|
|
|
meta = FieldAttribute(isa='string')
|
|
|
|
|
|
|
|
|
|
|
|
name = FieldAttribute(isa='string', post_validate='_set_name')
|
|
|
|
name = FieldAttribute(isa='string', validate=self._set_name)
|
|
|
|
|
|
|
|
|
|
|
|
no_log = FieldAttribute(isa='bool')
|
|
|
|
no_log = FieldAttribute(isa='bool')
|
|
|
|
notify = FieldAttribute(isa='list')
|
|
|
|
notify = FieldAttribute(isa='list')
|
|
|
|
poll = FieldAttribute(isa='integer')
|
|
|
|
poll = FieldAttribute(isa='integer')
|
|
|
@ -103,20 +104,6 @@ class Task(Base):
|
|
|
|
''' returns a human readable representation of the task '''
|
|
|
|
''' returns a human readable representation of the task '''
|
|
|
|
return "TASK: %s" % self.get_name()
|
|
|
|
return "TASK: %s" % self.get_name()
|
|
|
|
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
|
|
|
|
def load(self, block=None, role=None, data=None):
|
|
|
|
|
|
|
|
self = Task(block=block, role=role)
|
|
|
|
|
|
|
|
self._load_field_attributes(data) # from BaseObject
|
|
|
|
|
|
|
|
self._load_plugin_attributes(data) # from here, becuase of lookupPlugins
|
|
|
|
|
|
|
|
return self
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _load_plugin_attributes(self, data):
|
|
|
|
|
|
|
|
module_names = self._module_names()
|
|
|
|
|
|
|
|
for (k,v) in data.iteritems():
|
|
|
|
|
|
|
|
if k in module_names:
|
|
|
|
|
|
|
|
self.module = k
|
|
|
|
|
|
|
|
self.args = v
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ==================================================================================
|
|
|
|
# ==================================================================================
|
|
|
|
# BELOW THIS LINE
|
|
|
|
# BELOW THIS LINE
|
|
|
|