From 571697461d5095c2fa60779550718f242aba40b6 Mon Sep 17 00:00:00 2001 From: pyth0n1c <87383215+pyth0n1c@users.noreply.github.com> Date: Wed, 30 Apr 2025 10:27:06 -0700 Subject: [PATCH 1/4] support base case for test objects in particular --- contentctl/input/director.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contentctl/input/director.py b/contentctl/input/director.py index 260a5ede..5096ec70 100644 --- a/contentctl/input/director.py +++ b/contentctl/input/director.py @@ -338,7 +338,9 @@ def createSecurityContent( for err in error.errors(): error_msg = err.get("msg", "") if "https://errors.pydantic.dev" in error_msg: - continue + # Unfortunately, this is a catch-all for untyped errors. We will still need to emit this + # It will fall through the if/else statement below to the else condition. + pass # Clean error categorization if "Field required" in error_msg: From cdf6a5ff24bac45592f16e29ca16bdfca0632a3b Mon Sep 17 00:00:00 2001 From: pyth0n1c <87383215+pyth0n1c@users.noreply.github.com> Date: Wed, 30 Apr 2025 10:33:57 -0700 Subject: [PATCH 2/4] emit unknown messages without additional formatting --- contentctl/input/director.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/contentctl/input/director.py b/contentctl/input/director.py index 5096ec70..46553fc4 100644 --- a/contentctl/input/director.py +++ b/contentctl/input/director.py @@ -339,11 +339,14 @@ def createSecurityContent( error_msg = err.get("msg", "") if "https://errors.pydantic.dev" in error_msg: # Unfortunately, this is a catch-all for untyped errors. We will still need to emit this - # It will fall through the if/else statement below to the else condition. - pass + # This is harder to read, but the other option is suppressing it which we cannot do as + # it makes troubleshooting extremelt difficult + print( + f" {Colors.RED}{Colors.ERROR} {error_msg}{Colors.END}" + ) # Clean error categorization - if "Field required" in error_msg: + elif "Field required" in error_msg: print( f" {Colors.YELLOW}{Colors.WARNING} Field Required: {err.get('loc', [''])[0]}{Colors.END}" ) From e6e4857e3cc22ee9b8b041c8fd0f950c9bb736a5 Mon Sep 17 00:00:00 2001 From: Eric McGinnis Date: Wed, 30 Apr 2025 10:35:16 -0700 Subject: [PATCH 3/4] bump pyproject version patch --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 3d79af4b..69035274 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "contentctl" -version = "5.4.0" +version = "5.4.1" description = "Splunk Content Control Tool" authors = ["STRT "] From aa059a066dd5499f2e1c900a052f506e99d38adb Mon Sep 17 00:00:00 2001 From: Eric McGinnis Date: Wed, 30 Apr 2025 10:54:39 -0700 Subject: [PATCH 4/4] fix lint issue --- contentctl/input/director.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contentctl/input/director.py b/contentctl/input/director.py index 46553fc4..62b47b3d 100644 --- a/contentctl/input/director.py +++ b/contentctl/input/director.py @@ -339,7 +339,7 @@ def createSecurityContent( error_msg = err.get("msg", "") if "https://errors.pydantic.dev" in error_msg: # Unfortunately, this is a catch-all for untyped errors. We will still need to emit this - # This is harder to read, but the other option is suppressing it which we cannot do as + # This is harder to read, but the other option is suppressing it which we cannot do as # it makes troubleshooting extremelt difficult print( f" {Colors.RED}{Colors.ERROR} {error_msg}{Colors.END}"