autoupdate.py: Fix problem with logging hostlog messages
CL:1640975 mistakenly did not consider that a request can have be both
event type and app type. So this caused we never look into the proper
attributes of an incoming request.
This CL fixes that problem by picking attributes as long as they exist.
It also deprecates unused attributes:
- last_event_type
- last_event_status
- last_known_version
BUG=chromium:1013780
TEST=devserver_integration_test.py
TEST=autoupdate_unittest.py
Change-Id: I99ed2bb651967e605ca0fd879dc17f1e548b1cc5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/1857467
Tested-by: Amin Hassani <[email protected]>
Reviewed-by: Mike Frysinger <[email protected]>
Commit-Queue: Amin Hassani <[email protected]>
diff --git a/devserver.py b/devserver.py
index 547a12a..b4aa7eb 100755
--- a/devserver.py
+++ b/devserver.py
@@ -551,10 +551,13 @@
Returns:
A JSON dictionary containing all or some of the following fields:
- last_event_type (int): last update event type received
- last_event_status (int): last update event status received
- last_known_version (string): last known version reported in update ping
- timestamp: The timestamp the event was received.
+ version: The Chromium OS version the device is running.
+ track: The channel the device is running on.
+ board: The device's board.
+ event_result: The event result of Omaha request.
+ event_type: The event type of Omaha request.
+ previous_version: The Chromium OS version we updated and rebooted from.
+ timestamp: The timestamp the event was received.
See the OmahaEvent class in update_engine/omaha_request_action.h for
event type and status code definitions. If the ip does not exist an empty
string is returned.