Bug 1499902 - Improve device failure handling in AndroidMixin; r=bc

AndroidMixin properties are queried by mozharness prior to __init__
completion, so AttributeError is expected and is fairly safe to
ignore, but other exceptions should be reported.
This commit is contained in:
Geoff Brown 2018-10-19 08:43:19 -06:00
Родитель 2ed3dd4f7d
Коммит fa50cda6d3
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -55,7 +55,7 @@ class AndroidMixin(object):
@property
def device(self):
if not self._device:
if not self._device and self.adb_path:
try:
import mozdevice
self._device = mozdevice.ADBAndroid(adb=self.adb_path,
@ -63,7 +63,7 @@ class AndroidMixin(object):
verbose=True)
self.info("New mozdevice with adb=%s, device=%s" %
(self.adb_path, self.device_serial))
except Exception:
except AttributeError:
# As in adb_path, above.
pass
return self._device