@classmethod
  def generate_deployment_params(cls, options, node_layout, first_host,
    additional_creds):
    """Constructs a dict that tells the AppController which machines are part of
    this AppScale deployment, what their roles are, and how to host API services
    within this deployment.

    Args:
      options: A Namespace that dictates API service information, not including
        information about machine to role hosting.
      node_layout: A NodeLayout that indicates which machines host which roles
        (API services).
      first_host: A str that indicates which machine should be contacted by
        others to bootstrap and get initial service information.
      additional_creds: A dict that specifies arbitrary credentials that should
        also be passed in with the generated parameters.
    Returns:
      A dict whose keys indicate API service information as well as a special
      key that indicates machine to role mapping information.
    """
    creds = {
      "table" : options.table,
      "hostname" : first_host,
      "ips" : json.dumps(node_layout.to_list_without_head_node()),
      "keyname" : options.keyname,
      "replication" : str(node_layout.replication_factor()),
      "appengine" : str(options.appengine),
      "autoscale" : str(options.autoscale),
      "alter_etc_resolv" : str(options.alter_etc_resolv),
      "clear_datastore" : str(options.clear_datastore),
      "user_commands" : json.dumps(options.user_commands),
      "verbose" : str(options.verbose),
      "flower_password" : options.flower_password,
      "max_memory" : options.max_memory
    }
    creds.update(additional_creds)

    if options.infrastructure:
      iaas_creds = {
        'machine' : options.machine,
        'infrastructure' : options.infrastructure,
        'group' : options.group,
        'min_images' : node_layout.min_vms,
        'max_images' : node_layout.max_vms,
        'use_spot_instances' : options.use_spot_instances,
        'zone' : json.dumps(options.zone)
      }

      if options.infrastructure in ["ec2", "euca"]:
        iaas_creds['instance_type'] = options.instance_type
      elif options.infrastructure == "gce":
        iaas_creds['project'] = options.project
        iaas_creds['gce_user'] = getpass.getuser()
        iaas_creds['instance_type'] = options.gce_instance_type

      creds.update(iaas_creds)

    return creds
dataset/ETHPy150Open AppScale/appscale-tools/lib/local_state.py/LocalState.generate_deployment_params/original