SIENTIAPDE-1222
SIENTIAPDE-1222 Refactor server configuration handling in orchestrator_functions.py and update related tests - Removed the security_spec field from server configuration in build_tag_config to streamline the configuration process. - Updated test cases in test_formatters.py and test_orchestrator_functions.py to reflect the removal of security_spec, ensuring alignment with the new configuration structure and improving test accuracy.
This commit is contained in:
@@ -287,8 +287,6 @@ def build_tag_config(tag: dict[str, Any], slot_config: dict[str, Any],
|
||||
"server_cert_path": opc_servers[server_id].get('server_cert_path', None),
|
||||
"tags": {}
|
||||
}
|
||||
for name, spec in opc_servers[server_id].get('security_spec', {}).items():
|
||||
slot_config[f"{i}"][server_name][name] = spec
|
||||
|
||||
slot_config[f"{i}"][server_name]["tags"][tag['tag_address']] = {
|
||||
**tag,
|
||||
|
||||
@@ -121,10 +121,7 @@ async def test_process_slots(mock_build_tag_config, mock_gather_read_tags, forma
|
||||
"id": "1",
|
||||
"server_name": "test_server_name",
|
||||
"url": "test_url",
|
||||
"uri": "test_uri",
|
||||
"security_spec": {
|
||||
"test_name": "test_spec"
|
||||
}
|
||||
"uri": "test_uri"
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
@@ -157,10 +154,7 @@ async def test_process_slots(mock_build_tag_config, mock_gather_read_tags, forma
|
||||
"id": "1",
|
||||
"server_name": "test_server_name",
|
||||
"url": "test_url",
|
||||
"uri": "test_uri",
|
||||
"security_spec": {
|
||||
"test_name": "test_spec"
|
||||
}
|
||||
"uri": "test_uri"
|
||||
},
|
||||
"2": {
|
||||
"id": "2",
|
||||
@@ -186,10 +180,7 @@ async def test_process_slots(mock_build_tag_config, mock_gather_read_tags, forma
|
||||
"id": "1",
|
||||
"server_name": "test_server_name",
|
||||
"url": "test_url",
|
||||
"uri": "test_uri",
|
||||
"security_spec": {
|
||||
"test_name": "test_spec"
|
||||
}
|
||||
"uri": "test_uri"
|
||||
},
|
||||
"2": {
|
||||
"id": "2",
|
||||
@@ -215,10 +206,7 @@ async def test_process_slots(mock_build_tag_config, mock_gather_read_tags, forma
|
||||
"id": "1",
|
||||
"server_name": "test_server_name",
|
||||
"url": "test_url",
|
||||
"uri": "test_uri",
|
||||
"security_spec": {
|
||||
"test_name": "test_spec"
|
||||
}
|
||||
"uri": "test_uri"
|
||||
},
|
||||
"2": {
|
||||
"id": "2",
|
||||
@@ -238,7 +226,6 @@ async def test_process_slots(mock_build_tag_config, mock_gather_read_tags, forma
|
||||
"name": "test_server_name",
|
||||
"url": "test_url",
|
||||
"server_uri": "test_uri",
|
||||
"test_name": "test_spec",
|
||||
"cert_path": None,
|
||||
"private_key_path": None,
|
||||
"server_cert_path": None,
|
||||
@@ -317,15 +304,18 @@ async def test_process_slots_exception(mock_build_tag_config, mock_gather_read_t
|
||||
"server_name": "test_server_name",
|
||||
"url": "test_url",
|
||||
"uri": "test_uri",
|
||||
"security_spec": {
|
||||
"test_name": "test_spec"
|
||||
}
|
||||
"cert_path": 'test_cert_path',
|
||||
"private_key_path": 'test_private_key_path',
|
||||
"server_cert_path": 'test_server_cert_path'
|
||||
},
|
||||
{
|
||||
"id": "2",
|
||||
"server_name": "test_server_name2",
|
||||
"url": "test_url2",
|
||||
"uri": "test_uri2"
|
||||
"uri": "test_uri2",
|
||||
"cert_path": 'test_cert_path2',
|
||||
"private_key_path": 'test_private_key_path2',
|
||||
"server_cert_path": 'test_server_cert_path2'
|
||||
}
|
||||
],
|
||||
"active_ingestors": [
|
||||
|
||||
@@ -368,10 +368,7 @@ def test_build_tag_config():
|
||||
"1": {
|
||||
"server_name": "test_server_name",
|
||||
"url": "test_url",
|
||||
"uri": "test_uri",
|
||||
"security_spec": {
|
||||
"test_name": "test_spec"
|
||||
}
|
||||
"uri": "test_uri"
|
||||
}
|
||||
}
|
||||
slot_config = {
|
||||
@@ -395,8 +392,7 @@ def test_build_tag_config():
|
||||
"server_name": "test_server_name",
|
||||
"tag_address": "test_tag_address"
|
||||
}
|
||||
},
|
||||
"test_name": "test_spec"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user