Skip to content

Commit

Permalink
Only connect to S3 if deleting from object storage
Browse files Browse the repository at this point in the history
  • Loading branch information
nmassey001 committed Oct 9, 2024
1 parent 0bed453 commit b3c5577
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions nlds_utils/reset_object_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,14 @@ def reset_object_status(
raise click.UsageError("Error - group not specified")
if holding_id is None:
raise click.UsageError("Error - holding id not specified")
if access_key is None:
raise click.UsageError("Error - access key not specified")
if secret_key is None:
raise click.UsageError("Error - secret key not specified")

s3_client = _connect_to_s3(access_key, secret_key)
# only need to contact S3 if deleting from object storage
if delete:
s3_client = _connect_to_s3(access_key, secret_key)
if access_key is None:
raise click.UsageError("Error - access key not specified")
if secret_key is None:
raise click.UsageError("Error - secret key not specified")

nlds_cat = _connect_to_catalog()
nlds_cat.start_session()
Expand Down

0 comments on commit b3c5577

Please sign in to comment.