Logo Search packages:      
Sourcecode: ganeti version File versions  Download package

def lib::config::ConfigWriter::AllocatePort (   self  ) 

Allocate a port.

The port will be taken from the available port pool or from the
default port range (and in this case we increase
highest_used_port).

Definition at line 240 of file config.py.

00240                         :
    """Allocate a port.

    The port will be taken from the available port pool or from the
    default port range (and in this case we increase
    highest_used_port).

    """
    self._OpenConfig()

    # If there are TCP/IP ports configured, we use them first.
    if self._config_data.cluster.tcpudp_port_pool:
      port = self._config_data.cluster.tcpudp_port_pool.pop()
    else:
      port = self._config_data.cluster.highest_used_port + 1
      if port >= constants.LAST_DRBD_PORT:
        raise errors.ConfigurationError("The highest used port is greater"
                                        " than %s. Aborting." %
                                        constants.LAST_DRBD_PORT)
      self._config_data.cluster.highest_used_port = port

    self._WriteConfig()
    return port

  def GetHostKey(self):


Generated by  Doxygen 1.6.0   Back to index