Probably fixed handshake
This commit is contained in:
@@ -340,7 +340,7 @@ class PingAction(AlpineBitsAction):
|
|||||||
try:
|
try:
|
||||||
parsed_request = parser.from_string(request_xml, OtaPingRq)
|
parsed_request = parser.from_string(request_xml, OtaPingRq)
|
||||||
|
|
||||||
echo_data = json.loads(parsed_request.echo_data)
|
echo_data_client = json.loads(parsed_request.echo_data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
return AlpineBitsResponse(
|
return AlpineBitsResponse(
|
||||||
f"Error: Invalid XML request", HttpStatusCode.BAD_REQUEST
|
f"Error: Invalid XML request", HttpStatusCode.BAD_REQUEST
|
||||||
@@ -353,7 +353,7 @@ class PingAction(AlpineBitsAction):
|
|||||||
matching_capabilities = {"versions": []}
|
matching_capabilities = {"versions": []}
|
||||||
|
|
||||||
# Iterate through client's requested versions
|
# Iterate through client's requested versions
|
||||||
for client_version in echo_data.get("versions", []):
|
for client_version in echo_data_client.get("versions", []):
|
||||||
client_version_str = client_version.get("version", "")
|
client_version_str = client_version.get("version", "")
|
||||||
|
|
||||||
# Find matching server version
|
# Find matching server version
|
||||||
@@ -388,7 +388,7 @@ class PingAction(AlpineBitsAction):
|
|||||||
# Debug print to see what we matched
|
# Debug print to see what we matched
|
||||||
|
|
||||||
# Create successful ping response with matched capabilities
|
# Create successful ping response with matched capabilities
|
||||||
capabilities_json = json.dumps(matching_capabilities, indent=2)
|
capabilities_json = json.dumps(matching_capabilities, indent=4)
|
||||||
|
|
||||||
warning = OtaPingRs.Warnings.Warning(
|
warning = OtaPingRs.Warnings.Warning(
|
||||||
status=WarningStatus.ALPINEBITS_HANDSHAKE,
|
status=WarningStatus.ALPINEBITS_HANDSHAKE,
|
||||||
@@ -403,12 +403,12 @@ class PingAction(AlpineBitsAction):
|
|||||||
all_capabilities = capabilities_dict
|
all_capabilities = capabilities_dict
|
||||||
|
|
||||||
|
|
||||||
all_capabilities_json = json.dumps(all_capabilities, indent=2)
|
client_response_echo_data = json.dumps(echo_data_client, indent=4)
|
||||||
|
|
||||||
response_ota_ping = OtaPingRs(
|
response_ota_ping = OtaPingRs(
|
||||||
version="7.000",
|
version="7.000",
|
||||||
warnings=warning_response,
|
warnings=warning_response,
|
||||||
echo_data=all_capabilities_json,
|
echo_data=client_response_echo_data,
|
||||||
success="",
|
success="",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user