summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-06-21 11:37:22 -0400
committerScott Moser <smoser@ubuntu.com>2012-06-21 11:37:22 -0400
commit74f09aacd76eb62dd18a265b097378b55ae0fb50 (patch)
tree577890a21a3f7c9381a6e686b4fd513c01ee17df /cloudinit/util.py
parent142fad2a9a9acb702793c33269e04d8d01fa00d6 (diff)
downloadvyos-cloud-init-74f09aacd76eb62dd18a265b097378b55ae0fb50.tar.gz
vyos-cloud-init-74f09aacd76eb62dd18a265b097378b55ae0fb50.zip
use yaml.safe_load rather than yaml.load
LP: #1015818
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r--cloudinit/util.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index 47397418..84aae3ea 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -46,7 +46,7 @@ except ImportError:
def read_conf(fname):
try:
stream = open(fname, "r")
- conf = yaml.load(stream)
+ conf = yaml.safe_load(stream)
stream.close()
return conf
except IOError as e:
@@ -65,13 +65,13 @@ def get_base_cfg(cfgfile, cfg_builtin="", parsed_cfgs=None):
kern_contents = read_cc_from_cmdline()
if kern_contents:
- kerncfg = yaml.load(kern_contents)
+ kerncfg = yaml.safe_load(kern_contents)
# kernel parameters override system config
combined = mergedict(kerncfg, syscfg)
if cfg_builtin:
- builtin = yaml.load(cfg_builtin)
+ builtin = yaml.safe_load(cfg_builtin)
fin = mergedict(combined, builtin)
else:
fin = combined
@@ -282,7 +282,7 @@ def read_seeded(base="", ext="", timeout=5, retries=10, file_retries=0):
try:
md_str = readurl(md_url, timeout=timeout)
ud = readurl(ud_url, timeout=timeout)
- md = yaml.load(md_str)
+ md = yaml.safe_load(md_str)
return(md, ud)
except urllib2.HTTPError as e: