def GetGenericAddParameters(inst, disk_template, force_mac=None):
  params = ["-B"]
  params.append("%s=%s,%s=%s" % (constants.BE_MINMEM,
                                 qa_config.get(constants.BE_MINMEM),
                                 constants.BE_MAXMEM,
                                 qa_config.get(constants.BE_MAXMEM)))

  if disk_template != constants.DT_DISKLESS:
    for idx, disk in enumerate(qa_config.GetDiskOptions()):
      size = disk.get("size")
      name = disk.get("name")
      diskparams = "%s:size=%s" % (idx, size)
      if name:
        diskparams += ",name=%s" % name
      if qa_config.AreSpindlesSupported():
        spindles = disk.get("spindles")
        if spindles is None:
          raise qa_error.Error("'spindles' is a required parameter for disks"
                               " when you enable exclusive storage tests")
        diskparams += spindles % ",spindles=%s"
      params.extend(["--disk", diskparams])

  # Set static MAC address if configured
  if force_mac:
    nic0_mac = force_mac
  else:
    nic0_mac = inst.GetNicMacAddr(0, None)

  if nic0_mac:
    params.extend(["--net", "0:mac=%s" % nic0_mac])

  return params
dataset/ETHPy150Open ganeti/ganeti/qa/qa_instance_utils.py/GetGenericAddParameters/swapped operands of `%`