use yaml.safe_load rather than yaml.load

This commit is contained in:
Scott Moser 2012-06-21 11:37:22 -04:00
parent d3ad8ce4cf
commit fac802e19f
5 changed files with 9 additions and 8 deletions

View File

@ -2,6 +2,7 @@
- support relative path in AuthorizedKeysFile (LP: #970071).
- make apt-get update run with --quiet (suitable for logging) (LP: #1012613)
- cc_salt_minion: use package 'salt-minion' rather than 'salt' (LP: #996166)
- use yaml.safe_load rather than yaml.load (LP: #1015818)
0.6.3:
- add sample systemd config files [Garrett Holmstrom]
- add Fedora support [Garrent Holstrom] (LP: #883286)

View File

@ -293,7 +293,7 @@ if __name__ == "__main__":
if args.config:
import yaml
with open(args.config) as fp:
cfg = yaml.load(fp)
cfg = yaml.safe_load(fp)
if 'datasource' in cfg:
cfg = cfg['datasource']['MAAS']
for key in creds.keys():

View File

@ -94,7 +94,7 @@ def do_include(content, appendmsg):
def explode_cc_archive(archive, appendmsg):
for ent in yaml.load(archive):
for ent in yaml.safe_load(archive):
# ent can be one of:
# dict { 'filename' : 'value', 'content' : 'value', 'type' : 'value' }
# filename and type not be present

View File

@ -421,7 +421,7 @@ class CloudInit:
## for now, not doing this as it seems somewhat circular
## as CloudConfig does that also, merging it with this cfg
##
# ccfg = yaml.load(self.cloud_config_str)
# ccfg = yaml.safe_load(self.cloud_config_str)
# if ccfg is None: ccfg = {}
# self.cfg = util.mergedict(ccfg, self.cfg)
@ -537,7 +537,7 @@ def get_base_cfg(cfg_path=None):
def get_builtin_cfg():
return(yaml.load(cfg_builtin))
return(yaml.safe_load(cfg_builtin))
class DataSourceNotFoundException(Exception):

View File

@ -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: