Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

merge conflicts

  • Loading branch information...
commit 77eed3f4cc714de3007c3ae320117e3fb6f7d325 1 parent a159244
BuzzTroll authored
Showing with 0 additions and 29 deletions.
  1. +0 −29 cumulus/cb/pycb/cbRedirector.py
View
29 cumulus/cb/pycb/cbRedirector.py
@@ -1,9 +1,6 @@
import os
import sys
-<<<<<<< HEAD
import random
-=======
->>>>>>> adding a redirector abstraction
from pycb.cbException import cbException
import pycb
import stat
@@ -32,10 +29,6 @@ def end_connection(self, request):
class cbBasicRedirector(object):
def __init__(self, parser):
-<<<<<<< HEAD
-=======
- self.max = max_connections
->>>>>>> adding a redirector abstraction
self.connection_count = 0
self.host_file = parser.get("load_balanced", "hostfile")
self.max = int(parser.get("load_balanced", "max"))
@@ -43,22 +36,14 @@ def __init__(self, parser):
def new_connection(self, request):
h = None
self.connection_count = self.connection_count + 1
-<<<<<<< HEAD
if self.connection_count > self.max:
-=======
- if g_connection_count >= self.max:
->>>>>>> adding a redirector abstraction
h = self.get_next_host()
return h
def end_connection(self, request):
self.connection_count = self.connection_count - 1
-<<<<<<< HEAD
def get_next_host(self):
-=======
- def get_next_host():
->>>>>>> adding a redirector abstraction
try:
hosts = []
f = open(self.host_file, "r")
@@ -66,7 +51,6 @@ def get_next_host():
hosts.append(l.strip())
f.close()
-<<<<<<< HEAD
my_host = "%s:%d" % (pycb.config.hostname, pycb.config.port)
for i in range(0, 5):
ndx = random.randint(0, len(hosts)-1)
@@ -78,17 +62,4 @@ def get_next_host():
except Exception, ex:
pycb.log(logging.ERROR, "get next host error %s" % (str(ex)))
return None
-=======
- my_host = "%s:%d" % (pycb.config.hostname, pycb.config.port)
-
- for i in range(0, 10):
- ndx = random.randint(0, len(hosts)-1)
- h = hosts[ndx]
- if h != my_host:
- return h
- return h
- except Exception, ex:
- log(logging.ERROR, "get next host error %s" % (str(ex)))
- return None
->>>>>>> adding a redirector abstraction
Please sign in to comment.
Something went wrong with that request. Please try again.