Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jpdavis-prof committed Apr 16, 2024
1 parent e5d3d0e commit 64e70dd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cray/modules/artifacts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import datetime
import hashlib
import json
import os
import sys
import boto3
from boto3.s3.transfer import TransferConfig
Expand Down Expand Up @@ -152,6 +153,11 @@ def describe_object(ctx, bucket, obj):
@pass_context
def upload_object(ctx, bucket, obj, filename):
""" Create a new object in a bucket """
# Check if the file exists locally before creating the object
try:
os.path.isfile(filename)
except FileNotFoundError as err:
sys.exit(str(err))

s3client = get_s3_client()
md5sum = md5(filename)
Expand Down

0 comments on commit 64e70dd

Please sign in to comment.