Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

WIP: Prepare for karton5 migration #25

Merged
merged 2 commits into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.7
FROM python:3.9

WORKDIR /app/service
COPY ./requirements.txt ./requirements.txt
Expand Down
15 changes: 1 addition & 14 deletions karton/config_extractor/config_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ def args_parser(cls):
default=[],
nargs="+",
)
parser.add_argument(
"--identity",
help="Override the default Karton identity",
)
return parser

@classmethod
Expand All @@ -100,7 +96,6 @@ def main(cls):
config = Config(args.config_file)
service = ConfigExtractor(
config,
identity=args.identity,
modules=args.modules,
result_tags=args.tag,
result_attributes=dict(attributes),
Expand All @@ -110,7 +105,6 @@ def main(cls):
def __init__(
self,
config: Config,
identity: Optional[str],
modules: str,
result_tags: List[str],
result_attributes: Dict[str, List[str]],
Expand All @@ -119,17 +113,10 @@ def __init__(
Create instance of the ConfigExtractor.

:param config: Karton configuration object
:param identity: Override the default Karton identity.
:param modules: Path to a directory with malduck modules.
:param result_tags: Tags to be applied to all produced configs.
:param result_attributes: Attributes to be applied to all produced configs.
"""

# Identity must be overriden before the super() call, because parent
# constructor uses implicit default identity (from the class field).
if identity is not None:
self.identity = identity

super().__init__(config)

self.modules = ExtractorModules(modules)
Expand Down Expand Up @@ -271,7 +258,7 @@ def analyze_dumps(

self.log.info("done analysing, results: {}".format(json.dumps(results)))

def process(self, task: Task) -> None: # type: ignore
def process(self, task: Task) -> None:
sample = task.get_resource("sample")
headers = task.headers

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
karton-core>=4.2.0,<5.0.0
karton-core>=5.0.0,<6.0.0
malduck>=4.2.0,<5.0.0