OLD | NEW |
1 # Copyright (C) 2011 Google Inc. All rights reserved. | 1 # Copyright (C) 2011 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 if stderr_text: | 203 if stderr_text: |
204 _log.error('%s stderr:' % self._name) | 204 _log.error('%s stderr:' % self._name) |
205 for line in stderr_text.splitlines(): | 205 for line in stderr_text.splitlines(): |
206 _log.error(' %s' % line) | 206 _log.error(' %s' % line) |
207 else: | 207 else: |
208 _log.error('%s no stderr' % self._name) | 208 _log.error('%s no stderr' % self._name) |
209 else: | 209 else: |
210 _log.error('%s no stderr handle' % self._name) | 210 _log.error('%s no stderr handle' % self._name) |
211 else: | 211 else: |
212 _log.error('%s no process' % self._name) | 212 _log.error('%s no process' % self._name) |
213 if self._error_log_path: | 213 if self._error_log_path and self._filesystem.exists(self._error_log_path
): |
214 error_log_text = self._filesystem.read_text_file(self._error_log_pat
h) | 214 error_log_text = self._filesystem.read_text_file(self._error_log_pat
h) |
215 if error_log_text: | 215 if error_log_text: |
216 _log.error('%s error log (%s) contents:' % (self._name, self._er
ror_log_path)) | 216 _log.error('%s error log (%s) contents:' % (self._name, self._er
ror_log_path)) |
217 for line in error_log_text.splitlines(): | 217 for line in error_log_text.splitlines(): |
218 _log.error(' %s' % line) | 218 _log.error(' %s' % line) |
219 else: | 219 else: |
220 _log.error('%s error log empty' % self._name) | 220 _log.error('%s error log empty' % self._name) |
221 _log.error('') | 221 _log.error('') |
222 else: | 222 else: |
223 _log.error('%s no error log' % self._name) | 223 _log.error('%s no error log' % self._name) |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 except IOError, e: | 268 except IOError, e: |
269 if e.errno in (errno.EALREADY, errno.EADDRINUSE): | 269 if e.errno in (errno.EALREADY, errno.EADDRINUSE): |
270 raise ServerError('Port %d is already in use.' % port) | 270 raise ServerError('Port %d is already in use.' % port) |
271 elif self._platform.is_win() and e.errno in (errno.WSAEACCES,):
# pylint: disable=E1101 | 271 elif self._platform.is_win() and e.errno in (errno.WSAEACCES,):
# pylint: disable=E1101 |
272 raise ServerError('Port %d is already in use.' % port) | 272 raise ServerError('Port %d is already in use.' % port) |
273 else: | 273 else: |
274 raise | 274 raise |
275 finally: | 275 finally: |
276 s.close() | 276 s.close() |
277 _log.debug('all ports are available') | 277 _log.debug('all ports are available') |
OLD | NEW |