diff options
author | joshua Watt <JPEWhacker@gmail.com> | 2024-05-02 12:35:01 -0600 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2024-05-29 07:50:00 -0700 |
commit | 107a6cec757fff375a84357c982316a0ca77d69b (patch) | |
tree | fb5509a3cf3f68e226a40783cdc74a4586de4d9d | |
parent | 68f9a4b73d17839e0ec1f12a31fc1d42331cc42f (diff) | |
download | poky-107a6cec757fff375a84357c982316a0ca77d69b.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: 93190565fd1251e8f47d9a6291739f8b8ed5ec87)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit aa80b3cfc5d16dfba13ca7fb9b78bae179ce3b74)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
-rw-r--r-- | bitbake/lib/bb/cooker.py | 3 |
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( |