Revision bd061c35 lib/cmdlib.py

b/lib/cmdlib.py
6116 6116
      # TODO: make the ip check more flexible and not depend on the name check
6117 6117
      raise errors.OpPrereqError("Cannot do ip checks without a name check",
6118 6118
                                 errors.ECODE_INVAL)
6119
    # check disk information: either all adopt, or no adopt
6119

  
6120
    # check nics' parameter names
6121
    for nic in self.op.nics:
6122
      utils.ForceDictType(nic, constants.INIC_PARAMS_TYPES)
6123

  
6124
    # check disks. parameter names and consistent adopt/no-adopt strategy
6120 6125
    has_adopt = has_no_adopt = False
6121 6126
    for disk in self.op.disks:
6127
      utils.ForceDictType(disk, constants.IDISK_PARAMS_TYPES)
6122 6128
      if "adopt" in disk:
6123 6129
        has_adopt = True
6124 6130
      else:
......
8170 8176
    # Disk validation
8171 8177
    disk_addremove = 0
8172 8178
    for disk_op, disk_dict in self.op.disks:
8179
      utils.ForceDictType(disk_dict, constants.IDISK_PARAMS_TYPES)
8173 8180
      if disk_op == constants.DDM_REMOVE:
8174 8181
        disk_addremove += 1
8175 8182
        continue
......
8223 8230
    # NIC validation
8224 8231
    nic_addremove = 0
8225 8232
    for nic_op, nic_dict in self.op.nics:
8233
      utils.ForceDictType(nic_dict, constants.INIC_PARAMS_TYPES)
8226 8234
      if nic_op == constants.DDM_REMOVE:
8227 8235
        nic_addremove += 1
8228 8236
        continue

Also available in: Unified diff