Signed-off-by: Ian Main imain@redhat.com --- src/task-omatic/taskomatic.rb | 18 +++++++++++++++--- 1 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/task-omatic/taskomatic.rb b/src/task-omatic/taskomatic.rb index 3790b64..f09ffd3 100755 --- a/src/task-omatic/taskomatic.rb +++ b/src/task-omatic/taskomatic.rb @@ -137,14 +137,26 @@ class TaskOmatic state = Task::STATE_FINISHED begin case task.action - #when InstanceTask::CREATE - when 'InstanceCreate' - TaskomaticInstanceCreate.new(@logger) + when InstanceTask::CREATE + tasko_task = TaskomaticInstanceCreate.new(@logger) + when InstanceTask::START + tasko_task = TaskomaticInstanceStart.new(@logger) + when InstanceTask::STOP + tasko_task = TaskomaticInstanceStop.new(@logger) + when InstanceTask::REBOOT + tasko_task = TaskomaticInstanceReboot.new(@logger) + when InstanceTask::DESTROY + tasko_task = TaskomaticInstanceDestroy.new(@logger) else @logger.error "unknown task " + task.action state = Task::STATE_FAILED task.message = "Unknown task type" end + + # Implement the task.. this may be done in threads based on + # dependencies in the future. + tasko_task.run + rescue Exception => ex @logger.error "Task action processing failed: #{ex.class}: #{ex.message}" @logger.error ex.backtrace
deltacloud-devel@lists.fedorahosted.org