[PTP] Clear nodeinfo on notification worker init

The notificationclient is unable the query ptp status from the
notificationservice container after the node is restarted, or if the
notificationclient container is restarted.

The root issue is because the nodeinfo_repo created in
consume_location_event() is persisted between container restarts and the
location information stored there is not re-read into the DaemonControl
self.service_nodenames. This results in the notificationclient reporting
that the notificationservice is unreachable.

Fixed by clearing the entries in the nodeinfo repo on initialization so
that they can be re-created from incoming location announcements.

Test plan:
PASS: Build and deploy notificationclient image
PASS: Able to pull ptp status after container restart

Closes-bug: 1997266

Signed-off-by: Cole Walker <cole.walker@windriver.com>
Change-Id: I1a56d2c3fca050ab179b549e89e8cfa91f532f4d
This commit is contained in:
Cole Walker 2022-11-21 12:07:25 -05:00
parent 885056107a
commit ed75496b3e

View File

@ -71,6 +71,9 @@ class NotificationWorker:
self.service_nodenames = service_nodenames
nodeinfo_repo = NodeRepo(autocommit=True)
nodeinfo_repo.delete(Status=1)
self.__locationinfo_handler = \
NotificationWorker.LocationInfoHandler(self)
self.__notification_handler = NotificationHandler()