bosh_cli/lib/cli/job_property_validator.rb
# Tries to fill in each job template with job properties, collects errors
# @param [Hash] job_spec Job spec from the manifest
Tries to fill in each job template with job properties, collects errors
Tries to fill in each job template with job properties collects errors
def validate_templates(job_spec)
      built_job = @built_jobs[job_spec["template"]]
      if built_job.nil?
        raise CliError, "Job `#{job_spec["template"]}' has not been built"
      end
      collection = JobPropertyCollection.new(
        built_job, @manifest["properties"],
        job_spec["properties"], job_spec["property_mappings"])
      spec = {
        'job' => {
            'name' => job_spec['name']
        },
        'index' => 0,
        'networks' => job_network_spec(job_spec),
        'properties' => collection.to_hash
      }
      built_job.all_templates.each do |template_path|
        evaluate_template(built_job, template_path, spec)
      end
    end
def validate_templates ( job_spec ) built_job = @built_jobs [ job_spec [ "template" ] ] if built_job . nil? raise CliError , "Job `#{job_spec["template"]}' has not been built" end collection = JobPropertyCollection . new ( built_job , @manifest [ "properties" ] , job_spec [ "properties" ] , job_spec [ "property_mappings" ] ) spec = { 'job' => { 'name' => job_spec [ 'name' ] } , 'index' => 0 , 'networks' => job_network_spec ( job_spec ) , 'properties' => collection . to_hash } built_job . all_templates . each do | template_path | evaluate_template ( built_job , template_path , spec ) end end
Tries to fill in each job template with job properties, collects errors
Tries to fill in each job template with job properties collects errors
# Spec is usually more than that but jobs rarely use anything but # networks and properties.
job_spec
job_spec Job spec from the manifest
job_spec Job spec from the manifest