Skip to content

Commit 47c384e

Browse files
fastboot: check for connection status in _enter_fastboot
Change-Id: I1f6583cc356a5f0ba523887b1495999a3f532f27
1 parent b070798 commit 47c384e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lava_dispatcher/device/fastboot.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,6 @@ def power_on(self):
125125
if self._booted and self._target_type != 'android':
126126
self._setup_prompt()
127127
return self.proc
128-
if self.proc is not None:
129-
logging.warning('device already powered on, powering off first')
130-
self.power_off(self.proc)
131-
self.proc = None
132128
self._enter_fastboot()
133129
if self._use_boot_cmds:
134130
boot_cmds = ''.join(self._load_boot_cmds(default=self.driver.get_default_boot_cmds()))
@@ -185,6 +181,10 @@ def file_system(self, partition, directory):
185181
yield root
186182

187183
def _enter_fastboot(self):
184+
if self.proc is not None:
185+
logging.warning('Device already powered on, powering off first')
186+
self.power_off(self.proc)
187+
self.proc = None
188188
# Device needs to be forced into fastboot mode
189189
if not self.driver.in_fastboot():
190190
if self.config.fastboot_driver == 'capri' or \

0 commit comments

Comments
 (0)