From 013a4a93dff336a180e2c9fd544537aa30380957 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 10 Mar 2026 12:34:10 +0000 Subject: [PATCH] [cloud] Specify Google Cloud project explicitly for storage client The storage client is currently constructed with the project inferred from the environment, rather than using the project specified via the command line arguments. Fix by passing the project name to the storage client constructor. Signed-off-by: Michael Brown --- contrib/cloud/gce-import | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/cloud/gce-import b/contrib/cloud/gce-import index e7adfee84..555031c7b 100755 --- a/contrib/cloud/gce-import +++ b/contrib/cloud/gce-import @@ -32,9 +32,9 @@ def delete_temp_bucket(bucket): if not list(bucket.list_blobs()): bucket.delete() -def create_temp_bucket(location): +def create_temp_bucket(project, location): """Create temporary bucket (and remove any stale temporary buckets)""" - client = storage.Client() + client = storage.Client(project=project) for bucket in client.list_buckets(prefix=IPXE_STORAGE_PREFIX): delete_temp_bucket(bucket) name = '%s%s' % (IPXE_STORAGE_PREFIX, uuid4()) @@ -142,7 +142,7 @@ if not args.name: args.name = '%s-%s' % (args.family, date.today().strftime('%Y%m%d')) # Create temporary upload bucket -bucket = create_temp_bucket(args.location) +bucket = create_temp_bucket(args.project, args.location) # Use one thread per image to maximise parallelism with ThreadPoolExecutor(max_workers=len(args.image)) as executor: