Revision 36b66e6e lib/cmdlib.py

b/lib/cmdlib.py
5677 5677
          raise errors.OpPrereqError("Invalid MAC address specified: %s" %
5678 5678
                                     mac, errors.ECODE_INVAL)
5679 5679
        else:
5680
          # or validate/reserve the current one
5681
          if self.cfg.IsMacInUse(mac):
5680
          try:
5681
            self.cfg.ReserveMAC(mac, self.proc.GetECId())
5682
          except errors.ReservationError:
5682 5683
            raise errors.OpPrereqError("MAC address %s already in use"
5683 5684
                                       " in cluster" % mac,
5684 5685
                                       errors.ECODE_NOTUNIQUE)
......
5958 5959
    # creation job will fail.
5959 5960
    for nic in self.nics:
5960 5961
      if nic.mac in (constants.VALUE_AUTO, constants.VALUE_GENERATE):
5961
        nic.mac = self.cfg.GenerateMAC()
5962
        nic.mac = self.cfg.GenerateMAC(self.proc.GetECId())
5962 5963

  
5963 5964
    #### allocator run
5964 5965

  
......
7698 7699
                                     errors.ECODE_INVAL)
7699 7700
        elif nic_mac in (constants.VALUE_AUTO, constants.VALUE_GENERATE):
7700 7701
          # otherwise generate the mac
7701
          nic_dict['mac'] = self.cfg.GenerateMAC()
7702
          nic_dict['mac'] = self.cfg.GenerateMAC(self.proc.GetECId())
7702 7703
        else:
7703 7704
          # or validate/reserve the current one
7704
          if self.cfg.IsMacInUse(nic_mac):
7705
          try:
7706
            self.cfg.ReserveMAC(nic_mac, self.proc.GetECId())
7707
          except errors.ReservationError:
7705 7708
            raise errors.OpPrereqError("MAC address %s already in use"
7706 7709
                                       " in cluster" % nic_mac,
7707 7710
                                       errors.ECODE_NOTUNIQUE)

Also available in: Unified diff