fix: update search attribute keys and improve schedule handling
- Changed search attribute key from "Orchestrated" to "orchestrated" in temporal_manager.py and test cases. - Enhanced logging for schedule creation and updates in temporal_manager.py. - Updated schedule creation to use workflow_type directly instead of a hardcoded string. - Modified gather_read_tags function to use server_id instead of server_name for tag identification. - Adjusted test cases to reflect changes in server_id usage and ensure consistency across tests. - Fixed model_name retrieval in common_config to access nested models dictionary. - Updated test cases to align with new data structures and ensure accurate assertions.
This commit is contained in:
@@ -9,7 +9,7 @@ def common_config(config: dict[str, Any]):
|
||||
"max_retry_policy": config.get('max_retry_policy', 1),
|
||||
|
||||
"model_id": config['model_id'],
|
||||
"model_name": config['model_name'],
|
||||
"model_name": config['models']['name'],
|
||||
}
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@ def gather_read_tags(pipelines: list[dict[str, Any]]) -> dict[str, Any]:
|
||||
# Get all read tags from pipelines
|
||||
for pipeline in pipelines:
|
||||
for tag in pipeline['read_tags']:
|
||||
tag_string = f"{tag['server_name']}:{tag['tag_address']}"
|
||||
tag_string = f"{tag['server_id']}:{tag['tag_address']}"
|
||||
if tag_string not in tags:
|
||||
tags[tag_string] = {
|
||||
**tag,
|
||||
@@ -144,15 +144,17 @@ def gather_read_tags(pipelines: list[dict[str, Any]]) -> dict[str, Any]:
|
||||
|
||||
def build_tag_config(tag: dict[str, Any], slot_config: dict[str, Any],
|
||||
opc_servers: dict[str, Any], i: int):
|
||||
server_name = tag['server_name']
|
||||
server_id = tag['server_id']
|
||||
server_name = opc_servers[server_id]['server_name']
|
||||
if server_name not in slot_config[f"{i}"]:
|
||||
slot_config[f"{i}"][server_name] = {
|
||||
"server_id": server_id,
|
||||
"name": server_name,
|
||||
"url": opc_servers[server_name]['url'],
|
||||
"server_uri": opc_servers[server_name]['uri'],
|
||||
"url": opc_servers[server_id]['url'],
|
||||
"server_uri": opc_servers[server_id]['uri'],
|
||||
"tags": {}
|
||||
}
|
||||
for name, spec in opc_servers[server_name].get('security_spec', {}).items():
|
||||
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']] = {
|
||||
|
||||
Reference in New Issue
Block a user