From 9bd76fd8afd3a6ed6131549c3d9d280369af7e34 Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Thu, 7 Apr 2022 16:54:42 +0100 Subject: [PATCH] target: Fix Target.get_connection()'s busybox The conncetion returned by Target.get_connection() does not have its .busybox attribute initialized. This is expected for the first connection, but connections created for new threads should have busybox set. --- devlib/target.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/devlib/target.py b/devlib/target.py index 8fb5ce5..280005d 100644 --- a/devlib/target.py +++ b/devlib/target.py @@ -381,7 +381,10 @@ class Target(object): def get_connection(self, timeout=None): if self.conn_cls is None: raise ValueError('Connection class not specified on Target creation.') - return self.conn_cls(timeout=timeout, **self.connection_settings) # pylint: disable=not-callable + conn = self.conn_cls(timeout=timeout, **self.connection_settings) # pylint: disable=not-callable + # This allows forwarding the detected busybox for connections created in new threads. + conn.busybox = self.busybox + return conn def wait_boot_complete(self, timeout=10): raise NotImplementedError()