Revision 23e46494 lib/http.py

b/lib/http.py
456 456
  """
457 457
  MAX_CHILDREN = 20
458 458

  
459
  def __init__(self, mainloop, server_address):
459
  def __init__(self, mainloop, local_address, port):
460
    """Initializes the HTTP server
461

  
462
    @type mainloop: ganeti.daemon.Mainloop
463
    @param mainloop: Mainloop used to poll for I/O events
464
    @type local_addess: string
465
    @param local_address: Local IP address to bind to
466
    @type port: int
467
    @param port: TCP port to listen on
468

  
469
    """
460 470
    self.mainloop = mainloop
461
    self.server_address = server_address
471
    self.local_address = local_address
472
    self.port = port
462 473

  
463 474
    # TODO: SSL support
464 475
    self.ssl_cert = None
......
488 499
    mainloop.RegisterSignal(self)
489 500

  
490 501
  def Start(self):
491
    self.socket.bind(self.server_address)
502
    self.socket.bind((self.local_address, self.port))
492 503
    self.socket.listen(5)
493 504

  
494 505
  def Stop(self):

Also available in: Unified diff