diff options
author | Etienne Cordonnier <ecordonnier@snap.com> | 2024-08-23 10:41:08 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-08-25 15:37:02 +0100 |
commit | 58414305b289ae725f99c09bbfc74e9e162b4a4d (patch) | |
tree | 72755f5e59a2cb90075eeb57054e86389244e1f1 /bitbake/lib/bb/fetch2/npm.py | |
parent | f06fbe9bd8e90d9cabac25bf74b5c7e6f56b1877 (diff) | |
download | poky-58414305b289ae725f99c09bbfc74e9e162b4a4d.tar.gz |
bitbake: gcp.py: remove slow calls to gsutil stat
The changes of 1ab1d36c0af6fc58a974106b61ff4d37da6cb229 added calls to "gsutil stat" to avoid unhandled exceptions, however:
- in the case of checkstatus() this is redundant with the call to self.gcp_client.bucket(ud.host).blob(path).exists() which already returns True/False
and does not throw an exception in case the file does not exist.
- Also the call to gsutil stat is much slower than using the python client to call exists() so we should not replace the call to exists() with a call to gsutil stat.
- I think the intent of calling check_network_access in checkstatus() was to error-out in case the error is disabled. We can rather change the string "gsutil stat" to something else to make the code more readable.
- add a try/except block in download() instead of the extra call to gsutil
[RP: Tweak to avoid import until needed so google module isn't required for everyone]
(Bitbake rev: dd120f630e9ddadad95fe83728418335a14d3c3b)
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/npm.py')
0 files changed, 0 insertions, 0 deletions