# File lib/simp/cli/config/items_yaml_generator.rb, line 17
  def generate_yaml
    scenario_items_hash = load_scenario_items_yaml

    yaml  = "# Generated configuration tree YAML for '#{@scenario}' scenario.\n"
    yaml += "#\n"
    yaml += "---\n"
    scenario_items_hash['includes'].each do |part|
      substitutions = []
      part_name = nil
      if part.is_a?(Hash)
        part_name = part.keys[0]
        substitutions = part[part_name]
      else
        part_name = part
      end

      part_file = File.join(@scenarios_dir, 'parts', part_name)
      raise Simp::Cli::Config::InternalError.new("Cannot find '#{part_name}' include for '#{@scenario}' scenario") unless File.exist?(part_file)

      part_yaml = IO.read(part_file)
      part_yaml = make_substitutions(part_yaml, substitutions) unless substitutions.empty?
      yaml += part_yaml + "\n"
    end
    yaml
  end