summaryrefslogtreecommitdiffstats
path: root/bitbake
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:44 +0100
commitaff8b073341513394c64c8cb3045d2450786320b (patch)
tree4378a236bb34c8e9c0f0d2f3915a9866207d42eb /bitbake
parent8364aa5baa69adb04db33fc0d4c399c0fa7ec0cb (diff)
downloadpoky-aff8b073341513394c64c8cb3045d2450786320b.tar.gz
bitbake: 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 (Bitbake rev: aa80b3cfc5d16dfba13ca7fb9b78bae179ce3b74) Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 25b614f1e4..939a999974 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -318,9 +318,10 @@ class BBCooker:
318 try: 318 try:
319 with hashserv.create_client(upstream) as client: 319 with hashserv.create_client(upstream) as client:
320 client.ping() 320 client.ping()
321 except ConnectionError as e: 321 except (ConnectionError, ImportError) as e:
322 bb.warn("BB_HASHSERVE_UPSTREAM is not valid, unable to connect hash equivalence server at '%s': %s" 322 bb.warn("BB_HASHSERVE_UPSTREAM is not valid, unable to connect hash equivalence server at '%s': %s"
323 % (upstream, repr(e))) 323 % (upstream, repr(e)))
324 upstream = None
324 325
325 self.hashservaddr = "unix://%s/hashserve.sock" % self.data.getVar("TOPDIR") 326 self.hashservaddr = "unix://%s/hashserve.sock" % self.data.getVar("TOPDIR")
326 self.hashserv = hashserv.create_server( 327 self.hashserv = hashserv.create_server(