params: update `AthenadPid` to use integer type (#35871)

* params: update `AthenadPid` to use integer type

* fix type
pull/35874/head
Jason Wen 3 days ago committed by GitHub
parent 2e4de9b7d8
commit f5991caf6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      common/params_keys.h
  2. 4
      common/tests/test_params.py
  3. 2
      system/manager/process.py

@ -12,7 +12,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
{"ApiCache_Device", {PERSISTENT, STRING}}, {"ApiCache_Device", {PERSISTENT, STRING}},
{"ApiCache_FirehoseStats", {PERSISTENT, JSON}}, {"ApiCache_FirehoseStats", {PERSISTENT, JSON}},
{"AssistNowToken", {PERSISTENT, STRING}}, {"AssistNowToken", {PERSISTENT, STRING}},
{"AthenadPid", {PERSISTENT, STRING}}, {"AthenadPid", {PERSISTENT, INT}},
{"AthenadUploadQueue", {PERSISTENT, JSON}}, {"AthenadUploadQueue", {PERSISTENT, JSON}},
{"AthenadRecentlyViewedRoutes", {PERSISTENT, STRING}}, {"AthenadRecentlyViewedRoutes", {PERSISTENT, STRING}},
{"BootCount", {PERSISTENT, INT}}, {"BootCount", {PERSISTENT, INT}},

@ -37,9 +37,9 @@ class TestParams:
def test_params_two_things(self): def test_params_two_things(self):
self.params.put("DongleId", "bob") self.params.put("DongleId", "bob")
self.params.put("AthenadPid", "123") self.params.put("AthenadPid", 123)
assert self.params.get("DongleId") == "bob" assert self.params.get("DongleId") == "bob"
assert self.params.get("AthenadPid") == "123" assert self.params.get("AthenadPid") == 123
def test_params_get_block(self): def test_params_get_block(self):
def _delayed_writer(): def _delayed_writer():

@ -270,7 +270,7 @@ class DaemonProcess(ManagerProcess):
stderr=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'),
preexec_fn=os.setpgrp) preexec_fn=os.setpgrp)
self.params.put(self.param_name, str(proc.pid)) self.params.put(self.param_name, proc.pid)
def stop(self, retry=True, block=True, sig=None) -> None: def stop(self, retry=True, block=True, sig=None) -> None:
pass pass

Loading…
Cancel
Save