Revision 02a6b50a lib/cli.py

b/lib/cli.py
284 284
  "OPT_COMPL_ONE_OS",
285 285
  "OPT_COMPL_ONE_EXTSTORAGE",
286 286
  "cli_option",
287
  "FixHvParams",
287 288
  "SplitNodeOption",
288 289
  "CalculateOSNames",
289 290
  "ParseFields",
......
2581 2582
  return nics
2582 2583

  
2583 2584

  
2585
def FixHvParams(hvparams):
2586
  # In Ganeti 2.8.4 the separator for the usb_devices hvparam was changed from
2587
  # comma to space because commas cannot be accepted on the command line
2588
  # (they already act as the separator between different hvparams). Still,
2589
  # RAPI should be able to accept commas for backwards compatibility.
2590
  # Therefore, we convert spaces into commas here, and we keep the old
2591
  # parsing logic everywhere else.
2592
  try:
2593
    new_usb_devices = hvparams[constants.HV_USB_DEVICES].replace(" ", ",")
2594
    hvparams[constants.HV_USB_DEVICES] = new_usb_devices
2595
  except KeyError:
2596
    #No usb_devices, no modification required
2597
    pass
2598

  
2599

  
2584 2600
def GenericInstanceCreate(mode, opts, args):
2585 2601
  """Add an instance to the cluster via either creation or import.
2586 2602

  
......
2670 2686

  
2671 2687
  utils.ForceDictType(opts.beparams, constants.BES_PARAMETER_COMPAT)
2672 2688
  utils.ForceDictType(hvparams, constants.HVS_PARAMETER_TYPES)
2689
  FixHvParams(hvparams)
2673 2690

  
2674 2691
  if mode == constants.INSTANCE_CREATE:
2675 2692
    start = opts.start

Also available in: Unified diff