From 23c6d0bee5ca5b5a74716134f371a30556569c21 Mon Sep 17 00:00:00 2001 From: Johannes Nussbaum Date: Fri, 22 Mar 2024 20:16:27 +0100 Subject: [PATCH] modify log entries --- dsp_permissions_scripts/ap/ap_get.py | 1 + dsp_permissions_scripts/ap/ap_set.py | 3 ++- dsp_permissions_scripts/doap/doap_get.py | 1 + dsp_permissions_scripts/doap/doap_set.py | 3 ++- dsp_permissions_scripts/oap/oap_get.py | 4 ++-- dsp_permissions_scripts/oap/oap_set.py | 3 ++- 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dsp_permissions_scripts/ap/ap_get.py b/dsp_permissions_scripts/ap/ap_get.py index 194da4de..680462ea 100644 --- a/dsp_permissions_scripts/ap/ap_get.py +++ b/dsp_permissions_scripts/ap/ap_get.py @@ -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, diff --git a/dsp_permissions_scripts/ap/ap_set.py b/dsp_permissions_scripts/ap/ap_set.py index a6c6eda0..f5aace9c 100644 --- a/dsp_permissions_scripts/ap/ap_set.py +++ b/dsp_permissions_scripts/ap/ap_set.py @@ -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( @@ -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}") diff --git a/dsp_permissions_scripts/doap/doap_get.py b/dsp_permissions_scripts/doap/doap_get.py index 7475dc9c..0b291234 100644 --- a/dsp_permissions_scripts/doap/doap_get.py +++ b/dsp_permissions_scripts/doap/doap_get.py @@ -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, diff --git a/dsp_permissions_scripts/doap/doap_set.py b/dsp_permissions_scripts/doap/doap_set.py index 21827541..54e93145 100644 --- a/dsp_permissions_scripts/doap/doap_set.py +++ b/dsp_permissions_scripts/doap/doap_set.py @@ -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( @@ -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}") diff --git a/dsp_permissions_scripts/oap/oap_get.py b/dsp_permissions_scripts/oap/oap_get.py index 5aa9ace1..662913a5 100644 --- a/dsp_permissions_scripts/oap/oap_get.py +++ b/dsp_permissions_scripts/oap/oap_get.py @@ -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, @@ -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 diff --git a/dsp_permissions_scripts/oap/oap_set.py b/dsp_permissions_scripts/oap/oap_set.py index cd61afd5..51f95e04 100644 --- a/dsp_permissions_scripts/oap/oap_set.py +++ b/dsp_permissions_scripts/oap/oap_set.py @@ -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) @@ -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}")