Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Use the YAML unsafe loader instead of the safe loader #2041

Merged
1 commit merged into from
Aug 19, 2021
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
4 changes: 2 additions & 2 deletions intelmq/lib/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,14 @@ def set_queues(self, queues: Optional[str], queues_type: str):
q = {"_default": queues}
elif type_ is str:
q = {"_default": queues.split()}
elif type_ is dict:
elif isinstance(queues, dict):
q = queues
q.update({key: (val if isinstance(val, list) else val.split()) for key, val in queues.items()})
else:
raise exceptions.InvalidArgument(
'queues', got=queues,
expected=["None", "list of strings", "dict (of strings or lists that should have the _default key)"])
self.destination_queues = q
self.destination_queues = dict(q)
else:
raise exceptions.InvalidArgument('queues_type', got=queues_type, expected=['source', 'destination'])

Expand Down
2 changes: 1 addition & 1 deletion intelmq/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
from intelmq.lib.exceptions import DecodingError
from intelmq import RUNTIME_CONF_FILE

yaml = YAML(typ="safe", pure=True)
yaml = YAML(typ="unsafe", pure=True)

__all__ = ['base64_decode', 'base64_encode', 'decode', 'encode',
'load_configuration', 'load_parameters', 'log', 'parse_logline',
Expand Down