Skip to content

Commit

Permalink
parse bucket_name value as Python dictionary if it starts with '{'
Browse files Browse the repository at this point in the history
  • Loading branch information
boegel committed Nov 25, 2023
1 parent 9d7a4b7 commit dfc9baa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tasks/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# Standard library imports
from datetime import datetime, timezone
import glob
import json
import os
import re
import sys
Expand Down Expand Up @@ -258,6 +259,10 @@ def upload_tarball(job_dir, build_target, timestamp, repo_name, pr_number):
endpoint_url = deploycfg.get(ENDPOINT_URL) or ''
bucket_spec = deploycfg.get(BUCKET_NAME)

# if bucket_spec value looks like a dict, try parsing it as such
if bucket_spec.lstrip().startswith('{'):
bucket_spec = json.loads(bucket_spec)

jobcfg_path = os.path.join(job_dir, CFG_DIRNAME, JOB_CFG_FILENAME)
jobcfg = config.read_config(jobcfg_path)
target_repo_id = jobcfg[JOB_REPOSITORY][JOB_REPO_ID]
Expand Down

0 comments on commit dfc9baa

Please sign in to comment.