lib/mutx/tasks/task.rb in mutx-0.1.63 vs lib/mutx/tasks/task.rb in mutx-0.1.64
- old
+ new
@@ -42,11 +42,12 @@
:fr,
:sa,
:su,
:start_time,
:stop_time,
- :stop_bots
+ :stop_bots,
+ :task_status
REGEX_VALID_VALUES = ["failed","passed","none"]
NOTIFY_VALID_VALUES = ["any","passed","failed"]
def self.valid_types
@@ -91,10 +92,11 @@
@su = task_data["su"]
@start_time = task_data["start_time"]
@stop_time = task_data["stop_time"]
@notify_on = task_data["notify_on"] || "any"
@stop_bots = task_data["stop_bots"]
+ @task_status = task_data["task_status"] || "off"
else
Mutx::Support::Log.error "Creting task object. Argument is not a hash" if Mutx::Support::Log
raise "Task data not defined correctly. Expecting info about task"
end
save!
@@ -157,11 +159,12 @@
"su" => data["su"],
"start_time" => data["start_time"],
"stop_time" => data["stop_time"],
"value_for_regex" => data["value_for_regex"],
"notify_on" => data["notify_on"],
- "stop_bots" => data["stop_bots"]
+ "stop_bots" => data["stop_bots"],
+ "task_status" => data["task_status"]
}
self.new(task_data)
end
def self.validate_and_create(data)
@@ -298,11 +301,12 @@
"su" => su,
"start_time" => start_time,
"stop_time" => stop_time,
"value_for_regex" => value_for_regex,
"notify_on" => notify_on,
- "stop_bots" => stop_bots
+ "stop_bots" => stop_bots,
+ "task_status" => task_status
}
end
def has_custom_params?
!@custom_params.empty?
@@ -365,6 +369,6 @@
end
end
end
-end
\ No newline at end of file
+end