diff --git a/charmhelpers/contrib/templating/contexts.py b/charmhelpers/contrib/templating/contexts.py index a491fdb13..372eca344 100644 --- a/charmhelpers/contrib/templating/contexts.py +++ b/charmhelpers/contrib/templating/contexts.py @@ -118,7 +118,7 @@ def juju_state_to_yaml(yaml_path, namespace_separator=':', if os.path.exists(yaml_path): with open(yaml_path, "r") as existing_vars_file: - existing_vars = yaml.load(existing_vars_file.read()) + existing_vars = yaml.safe_load(existing_vars_file.read()) else: with open(yaml_path, "w+"): pass diff --git a/tools/charm_helpers_sync/charm_helpers_sync.py b/tools/charm_helpers_sync/charm_helpers_sync.py index 107ab6d07..09e20c6a0 100755 --- a/tools/charm_helpers_sync/charm_helpers_sync.py +++ b/tools/charm_helpers_sync/charm_helpers_sync.py @@ -34,7 +34,7 @@ def parse_config(conf_file): if not os.path.isfile(conf_file): logging.error('Invalid config file: %s.' % conf_file) return False - return yaml.load(open(conf_file).read()) + return yaml.safe_load(open(conf_file).read()) def clone_helpers(work_dir, repo):