Skip to content

Commit

Permalink
Merge pull request #85 from pytorch/malfet/fix-update-lambdas
Browse files Browse the repository at this point in the history
Fix download-lambdas.py
  • Loading branch information
malfet authored Jul 28, 2021
2 parents 529276f + 5acd751 commit cfb05c5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/scripts/download-lambdas.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@


def download_lambda(client, name, basename="."):
url = client.get_function(FunctionName=name)['Code']['Location']
func_info = client.get_function(FunctionName=name)
repo_type = func_info['Code']['RepositoryType']
if repo_type != 'S3':
print(f"Skipping {name}: hosted on unsupported repo type {repo_type}")
return
url = func_info['Code']['Location']

print(f"Downloading {name}")
with tempfile.NamedTemporaryFile(suffix='.zip') as tmp:
urllib.request.urlretrieve(url, tmp.name)
Expand Down

0 comments on commit cfb05c5

Please sign in to comment.