Revision 61be6ba4 scripts/gnt-instance

b/scripts/gnt-instance
899 899
    mac - the new MAC address of the instance
900 900

  
901 901
  """
902
  if not (opts.mem or opts.vcpus or opts.ip or opts.bridge or opts.mac or
903
          opts.hypervisor):
902
  if not (opts.ip or opts.bridge or opts.mac or
903
          opts.hypervisor or opts.beparams):
904 904
    logger.ToStdout("Please give at least one of the parameters.")
905 905
    return 1
906 906

  
907
  if constants.BE_MEMORY in opts.beparams:
908
    opts.beparams[constants.BE_MEMORY] = utils.ParseUnit(
909
      opts.beparams[constants.BE_MEMORY])
910

  
907 911
  op = opcodes.OpSetInstanceParams(instance_name=args[0],
908 912
                                   ip=opts.ip,
909 913
                                   bridge=opts.bridge, mac=opts.mac,
......
1109 1113
                    "Replaces all disks for the instance"),
1110 1114
  'modify': (SetInstanceParams, ARGS_ONE,
1111 1115
             [DEBUG_OPT, FORCE_OPT,
1112
              cli_option("-m", "--memory", dest="mem",
1113
                         help="Memory size",
1114
                         default=None, type="unit", metavar="<mem>"),
1115
              make_option("-p", "--cpu", dest="vcpus",
1116
                          help="Number of virtual CPUs",
1117
                          default=None, type="int", metavar="<PROC>"),
1118 1116
              make_option("-i", "--ip", dest="ip",
1119 1117
                          help="IP address ('none' or numeric IP)",
1120 1118
                          default=None, type="string", metavar="<ADDRESS>"),
......
1127 1125
              keyval_option("-H", "--hypervisor", type="keyval",
1128 1126
                            default={}, dest="hypervisor",
1129 1127
                            help="Change hypervisor parameters"),
1128
              keyval_option("-B", "--backend", type="keyval",
1129
                            default={}, dest="beparams",
1130
                            help="Change backend parameters"),
1130 1131
              SUBMIT_OPT,
1131 1132
              ],
1132 1133
             "<instance>", "Alters the parameters of an instance"),

Also available in: Unified diff