diff options
Diffstat (limited to 'bitbake/lib/bb')
| -rw-r--r-- | bitbake/lib/bb/fetch2/gcp.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/gcp.py b/bitbake/lib/bb/fetch2/gcp.py index f42c81fda8..f40ce2eaa5 100644 --- a/bitbake/lib/bb/fetch2/gcp.py +++ b/bitbake/lib/bb/fetch2/gcp.py | |||
| @@ -47,6 +47,7 @@ class GCP(FetchMethod): | |||
| 47 | ud.basename = os.path.basename(ud.path) | 47 | ud.basename = os.path.basename(ud.path) |
| 48 | 48 | ||
| 49 | ud.localfile = d.expand(urllib.parse.unquote(ud.basename)) | 49 | ud.localfile = d.expand(urllib.parse.unquote(ud.basename)) |
| 50 | ud.basecmd = "gsutil stat" | ||
| 50 | 51 | ||
| 51 | def get_gcp_client(self): | 52 | def get_gcp_client(self): |
| 52 | from google.cloud import storage | 53 | from google.cloud import storage |
| @@ -61,7 +62,8 @@ class GCP(FetchMethod): | |||
| 61 | if self.gcp_client is None: | 62 | if self.gcp_client is None: |
| 62 | self.get_gcp_client() | 63 | self.get_gcp_client() |
| 63 | 64 | ||
| 64 | bb.fetch2.check_network_access(d, "gsutil stat", ud.url) | 65 | bb.fetch2.check_network_access(d, ud.basecmd, f"gs://{ud.host}{ud.path}") |
| 66 | runfetchcmd("%s %s" % (ud.basecmd, f"gs://{ud.host}{ud.path}"), d) | ||
| 65 | 67 | ||
| 66 | # Path sometimes has leading slash, so strip it | 68 | # Path sometimes has leading slash, so strip it |
| 67 | path = ud.path.lstrip("/") | 69 | path = ud.path.lstrip("/") |
| @@ -88,7 +90,8 @@ class GCP(FetchMethod): | |||
| 88 | if self.gcp_client is None: | 90 | if self.gcp_client is None: |
| 89 | self.get_gcp_client() | 91 | self.get_gcp_client() |
| 90 | 92 | ||
| 91 | bb.fetch2.check_network_access(d, "gsutil stat", ud.url) | 93 | bb.fetch2.check_network_access(d, ud.basecmd, f"gs://{ud.host}{ud.path}") |
| 94 | runfetchcmd("%s %s" % (ud.basecmd, f"gs://{ud.host}{ud.path}"), d) | ||
| 92 | 95 | ||
| 93 | # Path sometimes has leading slash, so strip it | 96 | # Path sometimes has leading slash, so strip it |
| 94 | path = ud.path.lstrip("/") | 97 | path = ud.path.lstrip("/") |
