From 42b8dfd0ab71cf3f4de91d96795a5d5ded026e65 Mon Sep 17 00:00:00 2001 From: David Michaels Date: Fri, 23 Aug 2024 11:16:31 -0400 Subject: [PATCH] Minor changes to view-portal-object utility script. --- CHANGELOG.rst | 6 ++++++ dcicutils/scripts/view_portal_object.py | 7 ++++++- pyproject.toml | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6926218df..029e1c6d8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,12 @@ dcicutils Change Log ---------- +8.14.4 +====== + +* Minor changes to view-portal-object utility script. + + 8.14.3 ====== diff --git a/dcicutils/scripts/view_portal_object.py b/dcicutils/scripts/view_portal_object.py index 8696c94b6..7d440df2e 100644 --- a/dcicutils/scripts/view_portal_object.py +++ b/dcicutils/scripts/view_portal_object.py @@ -360,7 +360,12 @@ def write_insert_files(response: dict) -> None: path = f"/{uuid}" else: path = uuid - response = portal.get(path, raw=raw or inserts, database=database) + if (response := portal.get(path, raw=raw or inserts, database=database)) is not None: + if response.status_code == 403: + _exit(f"Permission error getting Portal object from {portal.server}: {uuid}") + elif response.status_code == 404: + _exit(f"Not found Portal object from {portal.server}: {uuid}") + except Exception as e: if "404" in str(e) and "not found" in str(e).lower(): _print(f"Portal object not found at {portal.server}: {uuid}") diff --git a/pyproject.toml b/pyproject.toml index 3d1dd5044..b2e3cbec1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "dcicutils" -version = "8.14.3" +version = "8.14.3.1b1" # TODO: To become 8.14.4 description = "Utility package for interacting with the 4DN Data Portal and other 4DN resources" authors = ["4DN-DCIC Team "] license = "MIT"