Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: testing/legion/client_lib.py

Issue 903873003: Fixing a small bug and changing the os to match the new environment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | testing/legion/examples/hello_world/host_test.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Defines the client library.""" 5 """Defines the client library."""
6 6
7 import argparse 7 import argparse
8 import datetime 8 import datetime
9 import logging 9 import logging
10 import os 10 import os
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 ]) 195 ])
196 196
197 self._ExecuteProcess(cmd) 197 self._ExecuteProcess(cmd)
198 198
199 def _ExecuteProcess(self, cmd): 199 def _ExecuteProcess(self, cmd):
200 """Executes a process, waits for it to complete, and checks for success.""" 200 """Executes a process, waits for it to complete, and checks for success."""
201 logging.debug('Running %s', ' '.join(cmd)) 201 logging.debug('Running %s', ' '.join(cmd))
202 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 202 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
203 _, stderr = p.communicate() 203 _, stderr = p.communicate()
204 if p.returncode != 0: 204 if p.returncode != 0:
205 stderr.seek(0)
206 raise Error(stderr) 205 raise Error(stderr)
207 206
208 def OnConnect(self, ip_address): 207 def OnConnect(self, ip_address):
209 """Receives client ip address on connection.""" 208 """Receives client ip address on connection."""
210 self._ip_address = ip_address 209 self._ip_address = ip_address
211 self._connected = True 210 self._connected = True
212 self._rpc = common_lib.ConnectToServer(self._ip_address) 211 self._rpc = common_lib.ConnectToServer(self._ip_address)
213 logging.info('%s connected from %s', self._name, ip_address) 212 logging.info('%s connected from %s', self._name, ip_address)
214 self._connect_event.set() 213 self._connect_event.set()
OLDNEW
« no previous file with comments | « no previous file | testing/legion/examples/hello_world/host_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698