Allow startup if update attempt occurs

update_attempt will block waiting for the update to complete and the
update will shutdown the running skills process if an update is needed.
pull/2236/head
Åke Forslund 2019-07-26 17:40:59 +02:00
parent 5eba242487
commit e9cc683dbe
1 changed files with 13 additions and 15 deletions

View File

@ -79,18 +79,20 @@ class DevicePrimer(object):
"""Internet dependent updates of various aspects of the device."""
self._get_pairing_status()
self._update_system_clock()
update_attempted = self._update_system()
if not update_attempted:
if self.time_skew_threshold_exceeded:
self._reboot()
if self.time_skew_threshold_exceeded:
self._reboot()
else:
self._update_system()
# Above will block during update process and kill this instance if
# new software is installed
if self.backend_down:
self._notify_backend_down()
else:
if self.backend_down:
self._notify_backend_down()
else:
self._display_skill_loading_notification()
self.bus.emit(Message('mycroft.internet.connected'))
self._ensure_device_is_paired()
self._update_device_attributes_on_backend()
self._display_skill_loading_notification()
self.bus.emit(Message('mycroft.internet.connected'))
self._ensure_device_is_paired()
self._update_device_attributes_on_backend()
def _get_pairing_status(self):
"""Set an instance attribute indicating the device's pairing status"""
@ -182,7 +184,6 @@ class DevicePrimer(object):
def _update_system(self):
"""Emit an update event that will be handled by the admin service."""
update_attempted = False
if not self.is_paired:
LOG.info('Attempting system update...')
self.bus.emit(Message('system.update'))
@ -198,9 +199,6 @@ class DevicePrimer(object):
'system.update.complete',
1000
)
update_attempted = True
return update_attempted
def _speak_dialog(self, dialog_id, wait=False):
data = {'utterance': dialog.get(dialog_id)}