@@ -74,10 +74,11 @@ def get_dev_settings(config):
7474 "ssl_context" : None ,
7575 "mwi_logs_root_dir" : mwi_config_folder / "ports" ,
7676 "mwi_proxy_lock_file_name" : "mwi_proxy.lock" ,
77+ "mw_context_tags" : get_mw_context_tags (matlab_proxy .get_default_config_name ()),
7778 }
7879
7980
80- def get (config = matlab_proxy .get_default_config_name (), dev = False ):
81+ def get (config_name = matlab_proxy .get_default_config_name (), dev = False ):
8182 """Returns the settings specific to the environment in which the server is running in
8283 If the environment variable 'TEST' is set to true, will make some changes to the dev settings.
8384
@@ -90,7 +91,7 @@ def get(config=matlab_proxy.get_default_config_name(), dev=False):
9091 """
9192
9293 if dev :
93- settings = get_dev_settings (config )
94+ settings = get_dev_settings (config_name )
9495
9596 # If running tests using Pytest, it will set environment variable TEST to true before running tests.
9697 # Will make test env specific changes before returning the settings.
@@ -159,7 +160,7 @@ def get(config=matlab_proxy.get_default_config_name(), dev=False):
159160 "mhlm_api_endpoint" : f"https://licensing{ ws_env_suffix } .mathworks.com/mls/service/v1/entitlement/list" ,
160161 "mwa_login" : f"https://login{ ws_env_suffix } .mathworks.com" ,
161162 "mwi_custom_http_headers" : mwi_custom_http_headers .get (),
162- "env_config" : mwi_validators .validate_env_config (config ),
163+ "env_config" : mwi_validators .validate_env_config (config_name ),
163164 "ssl_context" : get_ssl_context (
164165 ssl_cert_file = ssl_cert_file , ssl_key_file = ssl_key_file
165166 ),
@@ -168,9 +169,34 @@ def get(config=matlab_proxy.get_default_config_name(), dev=False):
168169 "mwi_logs_root_dir" : mwi_config_folder / "ports" ,
169170 # Name of the lock file which will be created by this instance of matlab-proxy process.
170171 "mwi_proxy_lock_file_name" : "mwi_proxy.lock" ,
172+ "mw_context_tags" : get_mw_context_tags (config_name ),
171173 }
172174
173175
176+ def get_mw_context_tags (extension_name ):
177+ """Returns a string which combines existing MW_CONTEXT_TAGS value and context tags
178+ specific to where matlab-proxy is being launched from.
179+
180+ Returns:
181+ str: Which combines existing MW_CONTEXT_TAGS with one from matlab-proxy.
182+ """
183+ existing_mw_context_tags = os .getenv ("MW_CONTEXT_TAGS" , "" )
184+
185+ if existing_mw_context_tags :
186+ logger .debug (f'Existing MW_CONTEXT_TAGS:"{ existing_mw_context_tags } "' )
187+ existing_mw_context_tags += ","
188+
189+ mwi_context_tags = matlab_proxy .get_mwi_ddux_value (extension_name )
190+ logger .debug (f'DDUX value for matlab-proxy "{ mwi_context_tags } "' )
191+
192+ combined_context_tags = existing_mw_context_tags + mwi_context_tags
193+ logger .debug (
194+ f'Combined DDUX value to be used for MATLAB process: "{ combined_context_tags } "'
195+ )
196+
197+ return combined_context_tags
198+
199+
174200def create_xvfb_cmd ():
175201 """Creates the Xvfb command with a write descriptor.
176202
0 commit comments