def GenerateJobFileString(filename, scenario_strings,
                          io_depths, working_set_size, block_size):

  if 'all' in scenario_strings:
    scenarios = SCENARIOS.itervalues()
  else:
    for name in scenario_strings:
      if name not in SCENARIOS:
        logging.error('Unknown scenario name %s', name)
    scenarios = (SCENARIOS[name] for name in scenario_strings)

  size_string = str(working_set_size) + 'G' if working_set_size else '100%'
  if block_size is not None:
    # If we don't make a copy here, this will modify the global
    # SCENARIOS variable.
    scenarios = [scenario.copy() for scenario in scenarios]
    for scenario in scenarios:
      scenario['blocksize'] = str(long(block_size.m_as(units.byte))) + 'B'

  job_file_template = jinja2.Template(JOB_FILE_TEMPLATE,
                                      undefined=jinja2.StrictUndefined)

  return str(job_file_template.render(
      minutes_per_job=MINUTES_PER_JOB,
      filename=filename,
      size=size_string,
      scenarios=scenarios,
      iodepths=io_depths))
Make a string with our fio job file.
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_benchmarks/fio_benchmark.py/GenerateJobFileString