Skip to content

Commit f7d6151

Browse files
author
astancu
committed
Replace yaml.load() with yaml.safe_load()
1 parent cf96216 commit f7d6151

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/ops/cli/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def get(self):
107107

108108
rendered = self.template.render(self.cluster_config_path, variables)
109109

110-
return yaml.load(rendered)
110+
return yaml.safe_load(rendered)
111111

112112
class ClusterConfigGenerator(object):
113113
def __init__(self, console_args, cluster_config_path, template):

src/ops/inventory/plugin/skms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def skms(args):
4141
credentials_file = "%s/.skms/credentials.yaml" % os.path.expanduser('~')
4242
if os.path.isfile(credentials_file):
4343
file_stream = open(credentials_file, "r")
44-
docs = yaml.load_all(file_stream)
44+
docs = yaml.safe_load_all(file_stream)
4545
for doc in docs:
4646
args['skms']['username'] = doc['username']
4747
args['skms']['password'] = doc['password']

src/ops/opsconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def __init__(self, console_args, package_dir):
102102
if os.path.isfile(config_path):
103103
logger.info("parsing %s", config_path)
104104
with open(config_path) as f:
105-
config = yaml.load(f.read())
105+
config = yaml.safe_load(f.read())
106106
if isinstance(config, dict):
107107
parsed_files.append(config_path)
108108
self.config.update(config)

0 commit comments

Comments
 (0)