def _ConfigureSpec(prime_client, clients):
  config_path = posixpath.join(_SPEC_DIR, _SPEC_CONFIG)

  stdout, _ = prime_client.RemoteCommand('pwd')
  exec_path = posixpath.join(stdout.strip(), _SPEC_DIR, 'binaries',
                             'linux', 'x64', 'netmist')
  configuration_overrides = {
      'USER': prime_client.user_name,
      'EXEC_PATH': exec_path.replace('/', '\/'),
      'CLIENT_MOUNTPOINTS': _MOUNTPOINTS_FILE,
      'BENCHMARK': FLAGS.specsfs2014_benchmark,
      'LOAD': FLAGS.specsfs2014_load,
      'NUM_RUNS': FLAGS.specsfs2014_num_runs,
      'INCR_LOAD': FLAGS.specsfs2014_incr_load
  }
  # Any special characters in the overrides dictionary should be escaped so
  # that they don't interfere with sed.
  sed_expressions = ' '.join(
      ['-e "s/{0}=.*/{0}={1}/"'.format(k, v)
       for k, v in configuration_overrides.iteritems()])
  sed_cmd = 'sudo sed -i {0} {1}'.format(sed_expressions, config_path)
  prime_client.RemoteCommand(sed_cmd)

  with vm_util.NamedTemporaryFile() as tf:
    for client in clients:
      tf.write('%s %s\n' % (client.internal_ip, _MOUNT_POINT))
    tf.close()
    prime_client.PushFile(tf.name, posixpath.join(_SPEC_DIR, _MOUNTPOINTS_FILE))
Render a parent block.
dataset/ETHPy150Open GoogleCloudPlatform/PerfKitBenchmarker/perfkitbenchmarker/linux_benchmarks/specsfs2014_benchmark.py/_ConfigureSpec--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/jinja2-2.6/jinja2/runtime.py/Context.super