Skip to content

Commit

Permalink
modify log entries
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Mar 22, 2024
1 parent c131443 commit 23c6d0b
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions dsp_permissions_scripts/ap/ap_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def get_aps_of_project(
token: str,
) -> list[Ap]:
"""Returns the Administrative Permissions for a project."""
logger.info(f"****** Retrieving all Administrative Permissions of project {shortcode} on server {host}... ******")
project_iri = get_project_iri_by_shortcode(
shortcode=shortcode,
host=host,
Expand Down
3 changes: 2 additions & 1 deletion dsp_permissions_scripts/ap/ap_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def apply_updated_aps_on_server(
if not aps:
logger.warning(f"There are no APs to update on {host}")
return
logger.info(f"Updating {len(aps)} APs on {host}...")
logger.info(f"****** Updating {len(aps)} Administrative Permissions on {host}... ******")
for ap in aps:
try:
_ = _update_ap_on_server(
Expand All @@ -61,3 +61,4 @@ def apply_updated_aps_on_server(
logger.info(f"Successfully updated AP {ap.iri}")
except ApiError as err:
logger.error(err)
logger.info(f"Finished updating {len(aps)} Administrative Permissions on {host}")
1 change: 1 addition & 0 deletions dsp_permissions_scripts/doap/doap_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def get_doaps_of_project(
Optionally, select only the DOAPs that are related to either a group, or a resource class, or a property.
By default, all DOAPs are returned, regardless of their target (target=all).
"""
logger.info(f"****** Retrieving all DOAPs of project {shortcode} on server {host}... ******")
project_iri = get_project_iri_by_shortcode(
shortcode=shortcode,
host=host,
Expand Down
3 changes: 2 additions & 1 deletion dsp_permissions_scripts/doap/doap_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def apply_updated_doaps_on_server(
if not doaps:
logger.warning(f"There are no DOAPs to update on {host}")
return
logger.info(f"Updating {len(doaps)} DOAPs on {host}...")
logger.info(f"****** Updating {len(doaps)} DOAPs on {host}... ******")
for d in doaps:
try:
_ = _update_doap_scope_on_server(
Expand All @@ -57,3 +57,4 @@ def apply_updated_doaps_on_server(
logger.info(f"Successfully updated DOAP {d.doap_iri}")
except ApiError as err:
logger.error(err)
logger.info(f"Finished updating {len(doaps)} DOAPs on {host}")
4 changes: 2 additions & 2 deletions dsp_permissions_scripts/oap/oap_get.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def get_all_resource_oaps_of_project(
token: str,
excluded_class_iris: Iterable[str] = (),
) -> list[Oap]:
logger.info(f"******* Getting all resource OAPs of project {shortcode} *******")
logger.info(f"******* Retrieving all resource OAPs of project {shortcode}... *******")
project_iri = get_project_iri_by_shortcode(
shortcode=shortcode,
host=host,
Expand All @@ -150,5 +150,5 @@ def get_all_resource_oaps_of_project(
token=token,
)
all_resource_oaps.extend(resource_oaps)
logger.info(f"Retrieved a TOTAL of {len(all_resource_oaps)} resource OAPs of project {shortcode}.")
logger.info(f"Retrieved a TOTAL of {len(all_resource_oaps)} resource OAPs of project {shortcode}")
return all_resource_oaps
3 changes: 2 additions & 1 deletion dsp_permissions_scripts/oap/oap_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def apply_updated_oaps_on_server(
if not resource_oaps:
logger.warning(f"There are no OAPs to update on {host}")
return
logger.info(f"******* Updating OAPs of {len(resource_oaps)} resources on {host} *******")
logger.info(f"******* Updating OAPs of {len(resource_oaps)} resources on {host}... *******")

failed_res_iris = _launch_thread_pool(resource_oaps, host, token, nthreads)

Expand All @@ -235,3 +235,4 @@ def apply_updated_oaps_on_server(
f"They were written to {filename}."
)
logger.error(msg)
logger.info(f"Updated OAPs of {len(resource_oaps)} resources on {host}")

0 comments on commit 23c6d0b

Please sign in to comment.