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

[#264] PyYAML load warning #296

Merged
merged 1 commit into from
Jan 7, 2020
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
3 changes: 2 additions & 1 deletion storops/lib/metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import os

import yaml
from yaml import loader

from storops.lib.common import RepeatedTimer, cache
from storops.lib.resource import ResourceList
Expand Down Expand Up @@ -196,7 +197,7 @@ def get_config(cls, name):
def _read_configs(cls):
filename = os.path.join(cls.get_folder(), cls.config_filename)
with open(filename, 'r') as stream:
ret = yaml.load(stream)
ret = yaml.load(stream, Loader=loader.SafeLoader)
return ret

@classmethod
Expand Down
3 changes: 2 additions & 1 deletion storops/lib/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import six

import yaml
from yaml import loader

from storops.lib.common import cache, instance_cache, Enum, \
get_clz_from_module, EnumList
Expand Down Expand Up @@ -357,7 +358,7 @@ def get_config(self, name):
def _read_configs(self):
filename = os.path.join(self.get_folder(), self.config_filename)
with open(filename, 'r') as stream:
ret = yaml.load(stream)
ret = yaml.load(stream, Loader=loader.SafeLoader)
return ret

@instance_cache
Expand Down