Skip to content
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
1 change: 1 addition & 0 deletions changelog/62021.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
utils/yamlloader and yamlloader_old: fix leaking DuplicateKeyWarning through a warnings module
11 changes: 0 additions & 11 deletions salt/utils/yamlloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
"""


import warnings

import salt.utils.stringutils
import yaml # pylint: disable=blacklisted-import
from yaml.constructor import ConstructorError
Expand All @@ -17,15 +15,6 @@
__all__ = ["SaltYamlSafeLoader", "load", "safe_load"]


class DuplicateKeyWarning(RuntimeWarning):
"""
Warned when duplicate keys exist
"""


warnings.simplefilter("always", category=DuplicateKeyWarning)


# with code integrated from https://gist.github.com/844388
class SaltYamlSafeLoader(BaseLoader):
"""
Expand Down
10 changes: 0 additions & 10 deletions salt/utils/yamlloader_old.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@


import re
import warnings

import salt.utils.stringutils
import yaml # pylint: disable=blacklisted-import
Expand All @@ -21,15 +20,6 @@
__all__ = ["SaltYamlSafeLoader", "load", "safe_load"]


class DuplicateKeyWarning(RuntimeWarning):
"""
Warned when duplicate keys exist
"""


warnings.simplefilter("always", category=DuplicateKeyWarning)


# with code integrated from https://gist.github.com/844388
class SaltYamlSafeLoader(yaml.SafeLoader):
"""
Expand Down