Revision 1862d460 lib/config.py

b/lib/config.py
96 96
      raise errors.ConfigurationError("Can't generate unique MAC")
97 97
    return mac
98 98

  
99
  def IsMacInUse(self, mac):
100
    """Predicate: check if the specified MAC is in use in the Ganeti cluster.
101

  
102
    This only checks instances managed by this cluster, it does not
103
    check for potential collisions elsewhere.
104

  
105
    """
106
    self._OpenConfig()
107
    self._ReleaseLock()
108
    all_macs = self._AllMACs()
109
    return mac in all_macs
110

  
99 111
  def _ComputeAllLVs(self):
100 112
    """Compute the list of all LVs.
101 113

  

Also available in: Unified diff