Commit e5b06e9e authored by qhoangxuan's avatar qhoangxuan

test doesn't run proxifying

parent d1378f36
......@@ -76,10 +76,11 @@ class APIEndpoint:
if not success:
raise zoe_api.exceptions.ZoeException('The Zoe master is unavailable, execution will be submitted automatically when the master is back up ({}).'.format(message))
if get_conf().proxy_type == 'apache':
proxy = zoe_api.proxy.apache.ApacheProxy(self)
else:
proxy = zoe_api.proxy.nginx.NginxProxy(self)
if get_conf().deployment_name != 'test':
if get_conf().proxy_type == 'apache':
proxy = zoe_api.proxy.apache.ApacheProxy(self)
else:
proxy = zoe_api.proxy.nginx.NginxProxy(self)
threading.Thread(target=proxy.proxify,args=(uid, role, new_id)).start()
return new_id
......@@ -95,11 +96,12 @@ class APIEndpoint:
raise zoe_api.exceptions.ZoeAuthException()
if e.is_active:
if get_conf().proxy_type == 'apache':
proxy = zoe_api.proxy.apache.ApacheProxy(self)
else:
proxy = zoe_api.proxy.nginx.NginxProxy(self)
proxy.unproxify(uid, role, exec_id)
if get_conf().deployment_name != 'test':
if get_conf().proxy_type == 'apache':
proxy = zoe_api.proxy.apache.ApacheProxy(self)
else:
proxy = zoe_api.proxy.nginx.NginxProxy(self)
proxy.unproxify(uid, role, exec_id)
return self.master.execution_terminate(exec_id)
else:
raise zoe_api.exceptions.ZoeException('Execution is not running')
......
......@@ -20,6 +20,7 @@ from typing import Dict
from zoe_lib.state import Service, Execution
from zoe_master.backends.proxy import gen_proxypath, JUPYTER_NOTEBOOK, MONGO_EXPRESS, JUPYTER_PORT, MONGO_PORT
from zoe_master.exceptions import ZoeStartExecutionFatalException
from zoe_lib.config import get_conf
def gen_environment(execution: Execution, service: Service, env_subst_dict: Dict):
""" Generate a dictionary containing the current cluster status (before the new container is spawned)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment