lib/chronicle/etl/cli/jobs.rb in chronicle-etl-0.5.0 vs lib/chronicle/etl/cli/jobs.rb in chronicle-etl-0.5.1
- old
+ new
@@ -57,11 +57,11 @@
run_job(job_definition)
rescue Chronicle::ETL::JobDefinitionError => e
message = ""
job_definition.errors.each_pair do |category, errors|
- message << "Problem with #{category}:\n - #{errors.map(&:to_s).join("\n -")}"
+ message << "Problem with #{category}:\n - #{errors.map(&:to_s).join("\n - ")}"
end
cli_fail(message: "Error running job.\n#{message}", exception: e)
end
desc "create", "Create a job"
@@ -110,9 +110,11 @@
end
private
def run_job(job_definition)
+ # FIXME: have to validate here so next method can work. This is clumsy
+ job_definition.validate!
# FIXME: clumsy to make CLI responsible for setting secrets here. Think about a better way to do this
job_definition.apply_default_secrets
job = Chronicle::ETL::Job.new(job_definition)
runner = Chronicle::ETL::Runner.new(job)