@@ -74,10 +74,11 @@ def get_dev_settings(config):
74
74
"ssl_context" : None ,
75
75
"mwi_logs_root_dir" : mwi_config_folder / "ports" ,
76
76
"mwi_proxy_lock_file_name" : "mwi_proxy.lock" ,
77
+ "mw_context_tags" : get_mw_context_tags (matlab_proxy .get_default_config_name ()),
77
78
}
78
79
79
80
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 ):
81
82
"""Returns the settings specific to the environment in which the server is running in
82
83
If the environment variable 'TEST' is set to true, will make some changes to the dev settings.
83
84
@@ -90,7 +91,7 @@ def get(config=matlab_proxy.get_default_config_name(), dev=False):
90
91
"""
91
92
92
93
if dev :
93
- settings = get_dev_settings (config )
94
+ settings = get_dev_settings (config_name )
94
95
95
96
# If running tests using Pytest, it will set environment variable TEST to true before running tests.
96
97
# 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):
159
160
"mhlm_api_endpoint" : f"https://licensing{ ws_env_suffix } .mathworks.com/mls/service/v1/entitlement/list" ,
160
161
"mwa_login" : f"https://login{ ws_env_suffix } .mathworks.com" ,
161
162
"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 ),
163
164
"ssl_context" : get_ssl_context (
164
165
ssl_cert_file = ssl_cert_file , ssl_key_file = ssl_key_file
165
166
),
@@ -168,9 +169,34 @@ def get(config=matlab_proxy.get_default_config_name(), dev=False):
168
169
"mwi_logs_root_dir" : mwi_config_folder / "ports" ,
169
170
# Name of the lock file which will be created by this instance of matlab-proxy process.
170
171
"mwi_proxy_lock_file_name" : "mwi_proxy.lock" ,
172
+ "mw_context_tags" : get_mw_context_tags (config_name ),
171
173
}
172
174
173
175
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
+
174
200
def create_xvfb_cmd ():
175
201
"""Creates the Xvfb command with a write descriptor.
176
202
0 commit comments