All of lore.kernel.org
 help / color / mirror / Atom feed
* [bitbake-devel][PATCH] cooker: Handle ImportError for websockets
@ 2024-05-02 18:35 Joshua Watt
  2025-02-20 16:05 ` Alexander Kanavin
       [not found] ` <1825F6393BB749ED.25123@lists.openembedded.org>
  0 siblings, 2 replies; 12+ messages in thread
From: Joshua Watt @ 2024-05-02 18:35 UTC (permalink / raw)
  To: bitbake-devel; +Cc: Joshua Watt

Handles ImportError when creating a hash equivalence to ping the server.
This notifies user earlier with a more precise error if websockets can't
be used, and also prevents passing a known bad upstream value to the
local server

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
---
 bitbake/lib/bb/cooker.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 25b614f1e44..939a9999746 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -318,9 +318,10 @@ class BBCooker:
                     try:
                         with hashserv.create_client(upstream) as client:
                             client.ping()
-                    except ConnectionError as e:
+                    except (ConnectionError, ImportError) as e:
                         bb.warn("BB_HASHSERVE_UPSTREAM is not valid, unable to connect hash equivalence server at '%s': %s"
                                  % (upstream, repr(e)))
+                        upstream = None
 
                 self.hashservaddr = "unix://%s/hashserve.sock" % self.data.getVar("TOPDIR")
                 self.hashserv = hashserv.create_server(
-- 
2.43.2



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-02-25 11:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-02 18:35 [bitbake-devel][PATCH] cooker: Handle ImportError for websockets Joshua Watt
2025-02-20 16:05 ` Alexander Kanavin
2025-02-21  9:16   ` Richard Purdie
2025-02-21 16:07     ` Joshua Watt
2025-02-25  8:22       ` Alexander Kanavin
2025-02-25 10:11         ` Richard Purdie
2025-02-25 10:40           ` Alexander Kanavin
2025-02-25 10:52             ` Richard Purdie
2025-02-25 11:48               ` Alexander Kanavin
     [not found] ` <1825F6393BB749ED.25123@lists.openembedded.org>
2025-02-21  9:11   ` Alexander Kanavin
2025-02-21  9:14     ` Richard Purdie
2025-02-21 12:18       ` Alexander Kanavin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.