mirror of
https://github.com/ipxe/ipxe.git
synced 2026-05-05 04:16:33 +02:00
[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 <mcb30@ipxe.org>
This commit is contained in:
parent
e180aa85e6
commit
013a4a93df
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user