forked from mitre/caldera
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
swapping planner to an object (mitre#642)
- Loading branch information
david
authored
Oct 24, 2019
1 parent
af518ce
commit 4e675ce
Showing
6 changed files
with
43 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from app.objects.base_object import BaseObject | ||
|
||
|
||
class Planner(BaseObject): | ||
|
||
@property | ||
def unique(self): | ||
return self.name | ||
|
||
@property | ||
def display(self): | ||
return dict(name=self.name, module=self.module, params=self.params) | ||
|
||
def __init__(self, name, module, params): | ||
self.name = name | ||
self.module = module | ||
self.params = params | ||
|
||
def store(self, ram): | ||
existing = self.retrieve(ram['planners'], self.unique) | ||
if not existing: | ||
ram['planners'].append(self) | ||
return self.retrieve(ram['planners'], self.unique) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule chain
updated
3 files
+1 −1 | app/chain_api.py | |
+1 −1 | static/js/sections.js | |
+1 −1 | templates/chain.html |