'Starts the process of adding a new server.'

def _AddServer(self, addr, port):

    if (port <= 0):
        print ('Wrong    port:    %d' % port)
        return
    pool = None
    try:
        pool = urllib3.connectionpool.HTTPConnectionPool(self.addr, port=self.port)
    except urllib3.exceptions.MaxRetryError:
        print 'Unable    to    contact    master...'
        return
    body = self._PackNewServer(addr, port)
    headers = {'Content-Length': len(body)}
    try:
        res = pool.urlopen('POST', '/servers/add/check', headers=headers, body=body)
    except urllib3.exceptions.MaxRetryError:
        print 'Unable    to    contact    master...'
        return
    if (res.status == constants.RESPONSE_EQUAL_DATA_SERVER):
        print 'Master    server    says    there    is    already    a    similar    server.'
        print 'Giving    up...'
        return
    if (res.status == constants.RESPONSE_DATA_SERVERS_UNREACHABLE):
        print 'Master    server    says    that    some    data    servers    are    not    running.'
        print 'Giving    up...'
        return
    if (res.status != constants.RESPONSE_OK):
        print 'Master    server    error.    Is    the    server    running?'
        return
    print ('Master    server    allows    us    to    add    server    %s:%d' % (addr, port))
    answer = raw_input(('Do    you    really    want    to    add    server    //%s:%d?    (y/n)    ' % (addr, port)))
    if (answer != 'y'):
        return
    try:
        res = pool.urlopen('POST', '/servers/add', headers=headers, body=body)
    except urllib3.exceptions.MaxRetryError:
        print 'Unable    to    contact    master...'
        return
    if (res.status == constants.RESPONSE_DATA_SERVERS_UNREACHABLE):
        print 'Master    server    says    that    some    data    servers    are    not    running.'
        print 'Giving    up...'
        return
    if (res.status == constants.RESPONSE_INCOMPLETE_SYNC):
        print 'The    master    server    has    set    up    the    new    server,    but    the    other    servers    may    not    know    about    it.'
        print "Please    run    'sync'    to    fix    the    problem."
        print 'Afterwards,    you    have    to    rebalance    server    data    with    the    following:'
        self._CompleteAddServerHelp(addr, port)
        return
    if (res.status != constants.RESPONSE_OK):
        print 'Failed    to    contact    master    server.'
        return
    print '============================================='
    print 'Operation    completed.'
    print 'To    rebalance    server    data    you    have    to    do    the    following:'
    self._CompleteAddServerHelp(addr, port)
    self.mapping = rdf_data_server.DataServerMapping.FromSerializedString(res.data)
