Skip to content

Commit

Permalink
Add settings to reset_storage_status
Browse files Browse the repository at this point in the history
  • Loading branch information
nmassey001 committed Feb 4, 2025
1 parent 6711964 commit 977b158
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion nlds_utils/reset_storage_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ def _remove_location_from_file(
type=str,
help="Storage Location type to delete records for. OBJECT_STORAGE|TAPE",
)
@click.option(
"-S",
"--settings",
default="",
type=str,
help="The location of the settings file for NLDS.",
)
def reset_storage_status(
user: str,
group: str,
Expand All @@ -139,6 +146,7 @@ def reset_storage_status(
force: bool,
delete: bool,
location: str,
settings: str,
) -> None:
"""Reset the tape status of a file by deleting a STORAGE LOCATION associated
with a file, if the details in the STORAGE LOCATION are empty.
Expand Down Expand Up @@ -172,7 +180,11 @@ def reset_storage_status(
else:
s3_client = None

nlds_cat = _connect_to_catalog()
if settings != "":
nlds_cat = _connect_to_catalog(settings)
else:
nlds_cat = _connect_to_catalog()

nlds_cat.start_session()
holding = nlds_cat.get_holding(user=user, group=group, holding_id=holding_id)[0]

Expand Down

0 comments on commit 977b158

Please sign in to comment.