in deepracer_systems_pkg/deepracer_systems_pkg/software_update_module/software_update_node.py [0:0]
def do_update_check(self):
"""Main function to perform the cache update, update the candidate list and
update_state flag.
"""
self.check_in_progress = True
self.get_logger().info("Checking software update...")
# Make sure we have network connection.
if not self.is_network_connected:
self.get_logger().info("Scheduling software update check to wait "
"for network connection...")
self.reschedule_software_update_check = True
return
# Update and Re-open the cache to read the updated package list
if not self.update_deepracer_cache():
self.check_complete.set()
self.check_in_progress = False
return
# Reset the package update list.
self.update_pkg_candidate_list()
with utility.AutoLock(self.state_guard):
# No packages found to update?
if len(self.update_list) == 0:
self.update_state = software_update_config.SoftwareUpdateState.UP_TO_DATE
else:
self.update_state = software_update_config.SoftwareUpdateState.UPDATE_AVAILABLE
self.pct_dict_db.put({software_update_config.PROG_STATE_KEY:
software_update_config.PROGRESS_STATES[1],
software_update_config.PROG_PCT_KEY: 0.0})
self.get_logger().info(self.get_state_description(self.update_state))
self.check_in_progress = False
self.check_complete.set()