aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoshua Watt <JPEWhacker@gmail.com>2024-05-02 12:35:01 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-05-08 14:51:14 +0100
commitaa80b3cfc5d16dfba13ca7fb9b78bae179ce3b74 (patch)
tree1cbeee221f8f8d3528851c2794decfa0a4b392f0
parenta313b4f07727e8187526157ba039911c3f73dd46 (diff)
downloadbitbake-contrib-aa80b3cfc5d16dfba13ca7fb9b78bae179ce3b74.tar.gz
cooker: Handle ImportError for websockets
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> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/cooker.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 25b614f1e..939a99997 100644
--- a/lib/bb/cooker.py
+++ b/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(