Skip to content

Commit

Permalink
Use the YAML unsafe loader instead of the safe loader
Browse files Browse the repository at this point in the history
This lets us be backwards compatible to JSON and still dump YAML in a
readable format.

Closes: #2003
  • Loading branch information
Birger Schacht authored and Birger Schacht committed Aug 19, 2021
1 parent d0370e1 commit 09e1d59
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 09e1d59

Please sign in to comment.