Lines Matching refs:peer
39 def run_cmd(peer, cmd): argument
43 result = peer.host.run(cmd)
56 def is_update_needed(peer, latest_commit): argument
63 return not is_commit_hash_equal(peer, latest_commit)
66 def is_commit_hash_equal(peer, latest_commit): argument
69 commit = peer.get_bt_commit_hash()
75 logging.debug('commit %s found on peer %s', commit, peer.host)
79 def perform_update(peer, latest_commit): argument
89 peer.host.send_file(bundle_path, '/tmp/')
107 status, _ = run_cmd(peer, cmd)
116 def restart_check_chameleond(peer): argument
123 status, _ = run_cmd(peer, restart_cmd)
125 status, _ = run_cmd(peer, start_cmd)
134 status, output = run_cmd(peer, status_cmd)
139 def update_peer(peer, latest_commit): argument
149 if peer.get_platform() != 'RASPI':
150 logging.error('Unsupported peer %s',str(peer.host))
153 if not perform_update(peer, latest_commit):
156 if not restart_check_chameleond(peer):
159 if is_update_needed(peer, latest_commit):
173 for peer in host.btpeer_list:
175 status[peer] = {}
176 status[peer]['update_needed'] = is_update_needed(peer,latest_commit)
182 for peer in host.btpeer_list:
183 if status[peer]['update_needed']:
184 status[peer]['updated'], status[peer]['reason'] = \
185 update_peer(peer, latest_commit)
190 for peer, v in status.items():
193 logging.error('updating peer %s failed %s', str(peer.host),