mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 17:31:33 +00:00
Support creating thread-local xmlrpc clients in SupervisorBaseMixin
This commit is contained in:
parent
780d6a9b3c
commit
9f6418bf60
@ -9,8 +9,18 @@ from os import remove
|
|||||||
from tfw.config import TFWENV
|
from tfw.config import TFWENV
|
||||||
|
|
||||||
|
|
||||||
|
def get_supervisor_instance():
|
||||||
|
return xmlrpc.client.ServerProxy(TFWENV.SUPERVISOR_HTTP_URI).supervisor
|
||||||
|
|
||||||
|
|
||||||
class SupervisorBaseMixin:
|
class SupervisorBaseMixin:
|
||||||
supervisor = xmlrpc.client.ServerProxy(TFWENV.SUPERVISOR_HTTP_URI).supervisor
|
supervisor = get_supervisor_instance()
|
||||||
|
|
||||||
|
def threadlocalise_supervisor_instance(self):
|
||||||
|
"""
|
||||||
|
Give this instance non-static, thread local xmlrpc client
|
||||||
|
"""
|
||||||
|
self.supervisor = get_supervisor_instance()
|
||||||
|
|
||||||
|
|
||||||
class SupervisorMixin(SupervisorBaseMixin):
|
class SupervisorMixin(SupervisorBaseMixin):
|
||||||
|
Loading…
Reference in New Issue
Block a user