mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-09-29 06:23:43 +08:00
Sentry: Handle unofficial device dongle id
This commit is contained in:
@@ -155,6 +155,12 @@ def manager_init() -> None:
|
||||
else:
|
||||
serial = params.get("HardwareSerial")
|
||||
raise Exception(f"Registration failed for device {serial}")
|
||||
if params.get("HardwareSerial") is None:
|
||||
try:
|
||||
serial = HARDWARE.get_serial()
|
||||
params.put("HardwareSerial", serial)
|
||||
except Exception:
|
||||
cloudlog.exception("Error getting serial for device")
|
||||
os.environ['DONGLE_ID'] = dongle_id # Needed for swaglog
|
||||
|
||||
if not is_dirty():
|
||||
|
||||
+3
-1
@@ -97,7 +97,9 @@ def get_properties() -> Tuple[str, str]:
|
||||
params = Params()
|
||||
dongle_id = params.get("DongleId", encoding='utf-8')
|
||||
if dongle_id in (None, UNREGISTERED_DONGLE_ID):
|
||||
dongle_id = UNREGISTERED_DONGLE_ID
|
||||
hardware_serial = params.get("HardwareSerial", encoding='utf-8')
|
||||
hardware_serial = "" if hardware_serial is None else hardware_serial
|
||||
dongle_id = UNREGISTERED_DONGLE_ID + hardware_serial
|
||||
gitname = params.get("GithubUsername", encoding='utf-8')
|
||||
if gitname is None:
|
||||
gitname = ""
|
||||
|
||||
Reference in New Issue
Block a user