Revision ca519248

b/lib/cmdlib.py
15662 15662
    mn = self.cfg.GetMasterNode()
15663 15663
    return ([mn], [mn])
15664 15664

  
15665
  def CheckArguments(self):
15666
    if self.op.mac_prefix:
15667
      self.op.mac_prefix = \
15668
        utils.NormalizeAndValidateThreeOctetMacPrefix(self.op.mac_prefix)
15669

  
15665 15670
  def ExpandNames(self):
15666 15671
    self.network_uuid = self.cfg.GenerateUniqueID(self.proc.GetECId())
15667 15672

  
......
15676 15681
    self.add_locks[locking.LEVEL_NETWORK] = self.network_uuid
15677 15682

  
15678 15683
  def CheckPrereq(self):
15679
    """Check prerequisites.
15680

  
15681
    This checks that the given group name is not an existing node group
15682
    already.
15683

  
15684
    """
15685 15684
    if self.op.network is None:
15686 15685
      raise errors.OpPrereqError("Network must be given",
15687 15686
                                 errors.ECODE_INVAL)
......
15692 15691
      raise errors.OpPrereqError("Network '%s' already defined" %
15693 15692
                                 self.op.network, errors.ECODE_EXISTS)
15694 15693

  
15695
    if self.op.mac_prefix:
15696
      utils.NormalizeAndValidateMac(self.op.mac_prefix + ":00:00:00")
15697

  
15698 15694
    # Check tag validity
15699 15695
    for tag in self.op.tags:
15700 15696
      objects.TaggableObject.ValidateTag(tag)
......
15896 15892
      if self.op.mac_prefix == constants.VALUE_NONE:
15897 15893
        self.mac_prefix = None
15898 15894
      else:
15899
        utils.NormalizeAndValidateMac(self.op.mac_prefix + ":00:00:00")
15900
        self.mac_prefix = self.op.mac_prefix
15895
        self.mac_prefix = \
15896
          utils.NormalizeAndValidateThreeOctetMacPrefix(self.op.mac_prefix)
15901 15897

  
15902 15898
    if self.op.gateway6:
15903 15899
      if self.op.gateway6 == constants.VALUE_NONE:

Also available in: Unified diff