Revision 2a518543

b/lib/cmdlib.py
6391 6391
      self.src_images = disk_images
6392 6392

  
6393 6393
      old_name = export_info.get(constants.INISECT_INS, 'name')
6394
      # FIXME: int() here could throw a ValueError on broken exports
6395
      exp_nic_count = int(export_info.get(constants.INISECT_INS, 'nic_count'))
6394
      try:
6395
        exp_nic_count = export_info.getint(constants.INISECT_INS, 'nic_count')
6396
      except (TypeError, ValueError), err:
6397
        raise errors.OpPrereqError("Invalid export file, nic_count is not"
6398
                                   " an integer: %s" % str(err),
6399
                                   errors.ECODE_STATE)
6396 6400
      if self.op.instance_name == old_name:
6397 6401
        for idx, nic in enumerate(self.nics):
6398 6402
          if nic.mac == constants.VALUE_AUTO and exp_nic_count >= idx:

Also available in: Unified diff