Skip to content

Commit

Permalink
Remove dead code from
Browse files Browse the repository at this point in the history
new_content.py
  • Loading branch information
pyth0n1c committed Dec 6, 2024
1 parent 0237ccd commit 6f394cc
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions contentctl/actions/new_content.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,23 +110,3 @@ def execute(self, input_dto: new) -> None:
full_output_path = input_dto.path / subdirectory / SecurityContentObject_Abstract.contentNameToFileName(content_dict.get('name'))
YmlWriter.writeYmlFile(str(full_output_path), content_dict)



def writeObjectNewContent(self, object: dict, subdirectory_name: str, type: NewContentType) -> None:
if type == NewContentType.detection:
file_path = os.path.join(self.output_path, 'detections', subdirectory_name, self.convertNameToFileName(object['name'], object['tags']['product']))
output_folder = pathlib.Path(self.output_path)/'detections'/subdirectory_name
#make sure the output folder exists for this detection
output_folder.mkdir(exist_ok=True)

YmlWriter.writeDetection(file_path, object)
print("Successfully created detection " + file_path)

elif type == NewContentType.story:
file_path = os.path.join(self.output_path, 'stories', self.convertNameToFileName(object['name'], object['tags']['product']))
YmlWriter.writeStory(file_path, object)
print("Successfully created story " + file_path)

else:
raise(Exception(f"Object Must be Story or Detection, but is not: {object}"))

0 comments on commit 6f394cc

Please sign in to comment.