Skip to content

Commit 44cbee7

Browse files
removing hardcoded references to ESCU and the ESCU app UID
1 parent f00e886 commit 44cbee7

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

contentctl/actions/inspect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def check_detection_metadata(self, config: inspect) -> None:
279279
"""
280280
# TODO (#282): We should be inspect the same artifact we're passing around from the
281281
# build stage ideally
282-
# Unpack the savedsearch.conf of each ESCU package
282+
# Unpack the savedsearch.conf of each app package
283283
current_build_conf = SavedsearchesConf.init_from_package(
284284
package_path=config.getPackageFilePath(include_version=False),
285285
app_name=config.app.label,

contentctl/objects/config.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
ValidationInfo
2020
)
2121

22-
from contentctl.objects.constants import ESCU_APP_UID, DOWNLOADS_DIRECTORY
22+
from contentctl.objects.constants import DOWNLOADS_DIRECTORY
2323
from contentctl.output.yml_writer import YmlWriter
2424
from contentctl.helper.utils import Utils
2525
from contentctl.objects.enums import PostTestBehavior, DetectionTestingMode
@@ -286,7 +286,7 @@ class inspect(build):
286286
default=None,
287287
description=(
288288
"Local path to the previous app build for metatdata validation and versioning "
289-
"enforcement (defaults to the latest release of ESCU published on Splunkbase)."
289+
"enforcement (defaults to the latest release of the app published on Splunkbase)."
290290
)
291291
)
292292
stack_type: StackType = Field(description="The type of your Splunk Cloud Stack")
@@ -317,14 +317,17 @@ def get_previous_package_file_path(self) -> pathlib.Path:
317317
latest version is downloaded from Splunkbase and it's filepath is returned, and saved to the
318318
in-memory config (so download doesn't happen twice in the same run).
319319
320-
:returns: Path object to previous ESCU build
320+
:returns: Path object to previous app build
321321
:rtype: :class:`pathlib.Path`
322322
"""
323323
previous_build_path = self.previous_build
324324
# Download the previous build as the latest release on Splunkbase if no path was provided
325325
if previous_build_path is None:
326-
print("Downloading latest ESCU build from Splunkbase to serve as previous build during validation...")
327-
app = SplunkApp(app_uid=ESCU_APP_UID)
326+
print(
327+
f"Downloading latest {self.app.label} build from Splunkbase to serve as previous "
328+
"build during validation..."
329+
)
330+
app = SplunkApp(app_uid=self.app.uid)
328331
previous_build_path = app.download(
329332
out=pathlib.Path(DOWNLOADS_DIRECTORY),
330333
username=self.splunk_api_username,

contentctl/objects/constants.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,5 @@
138138
"Victim": 1
139139
}
140140

141-
# The app UID in Splunkbase of ESCU
142-
ESCU_APP_UID = 3449
143-
144141
# The relative path to the directory where any apps/packages will be downloaded
145142
DOWNLOADS_DIRECTORY = "downloads"

contentctl/objects/savedsearches_conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ def _parse_detection_stanzas(self) -> None:
133133
for line in file:
134134
self._current_line_no += 1
135135

136-
# Break when we get to the end of the ESCU detections
137-
if line.strip() == "### END ESCU DETECTIONS ###":
136+
# Break when we get to the end of the app detections
137+
if line.strip() == f"### END {self.app_label} DETECTIONS ###":
138138
break
139139
elif self._in_detections:
140140
# Check if we are in the detections portion of the conf, and then if we are in a
@@ -164,7 +164,7 @@ def _parse_detection_stanzas(self) -> None:
164164
"Found a non-empty line outside a stanza [see line "
165165
f"{self._current_line_no} in {self.path}]."
166166
)
167-
elif line.strip() == "### ESCU DETECTIONS ###":
167+
elif line.strip() == f"### {self.app_label} DETECTIONS ###":
168168
# We have hit the detections portion of the conf and we adjust the state
169169
# accordingly
170170
self._in_detections = True

0 commit comments

Comments
 (0)