Revision 9b12ed0f lib/cmdlib.py

b/lib/cmdlib.py
6265 6265
                                   " is missing the disk_template information",
6266 6266
                                   errors.ECODE_INVAL)
6267 6267

  
6268
    if not self.op.disks:
6269
      if einfo.has_option(constants.INISECT_INS, "disk_count"):
6270
        disks = []
6271
        # TODO: import the disk iv_name too
6272
        for idx in range(einfo.getint(constants.INISECT_INS, "disk_count")):
6273
          disk_sz = einfo.getint(constants.INISECT_INS, "disk%d_size" % idx)
6274
          disks.append({"size": disk_sz})
6275
        self.op.disks = disks
6276
      else:
6277
        raise errors.OpPrereqError("No disk info specified and the export"
6278
                                   " is missing the disk information",
6279
                                   errors.ECODE_INVAL)
6280

  
6268 6281
    if (self.op.hypervisor is None and
6269 6282
        einfo.has_option(constants.INISECT_INS, "hypervisor")):
6270 6283
      self.op.hypervisor = einfo.get(constants.INISECT_INS, "hypervisor")

Also available in: Unified diff