Make sure we wait for a gearman server
Change-Id: I4cc5f5b6fb50a77116aeede4a450bd8281a5a5a9
This commit is contained in:
parent
3baaa0d160
commit
b39f8840d6
@ -112,12 +112,13 @@ class ZuulClient(threading.Thread):
|
|||||||
self.global_config['zuul_server']['gearman_host'],
|
self.global_config['zuul_server']['gearman_host'],
|
||||||
self.global_config['zuul_server']['gearman_port']
|
self.global_config['zuul_server']['gearman_port']
|
||||||
)
|
)
|
||||||
self.register_functions()
|
self.gearman_worker.waitForServer()
|
||||||
|
|
||||||
def register_functions(self):
|
def register_functions(self):
|
||||||
self.log.debug("Register functions with gearman")
|
self.log.debug("Register functions with gearman")
|
||||||
for function_name, plugin in self.functions.items():
|
for function_name, plugin in self.functions.items():
|
||||||
self.gearman_worker.registerFunction(function_name)
|
self.gearman_worker.registerFunction(function_name)
|
||||||
|
self.log.debug(self.gearman_worker.functions)
|
||||||
|
|
||||||
def add_function(self, function_name, plugin):
|
def add_function(self, function_name, plugin):
|
||||||
self.log.debug("Add function, %s, to list" % function_name)
|
self.log.debug("Add function, %s, to list" % function_name)
|
||||||
|
@ -48,6 +48,9 @@ class Server(object):
|
|||||||
self.zuul_manager = None
|
self.zuul_manager = None
|
||||||
self.zuul_client = None
|
self.zuul_client = None
|
||||||
self.plugins = []
|
self.plugins = []
|
||||||
|
|
||||||
|
# TODO: Make me unique (random?) and we should be able to run multiple
|
||||||
|
# instances of turbo-hipster on the one host
|
||||||
self.worker_name = os.uname()[1]
|
self.worker_name = os.uname()[1]
|
||||||
|
|
||||||
self.tasks = {}
|
self.tasks = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user