diff options
| -rw-r--r-- | ChangeLog | 1 | ||||
| -rw-r--r-- | cloudinit/DataSourceMAAS.py | 2 | ||||
| -rw-r--r-- | cloudinit/UserDataHandler.py | 2 | ||||
| -rw-r--r-- | cloudinit/__init__.py | 4 | ||||
| -rw-r--r-- | cloudinit/util.py | 8 | 
5 files changed, 9 insertions, 8 deletions
@@ -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) diff --git a/cloudinit/DataSourceMAAS.py b/cloudinit/DataSourceMAAS.py index 61a0038f..e3e62057 100644 --- a/cloudinit/DataSourceMAAS.py +++ b/cloudinit/DataSourceMAAS.py @@ -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(): diff --git a/cloudinit/UserDataHandler.py b/cloudinit/UserDataHandler.py index ec914480..bf694a8e 100644 --- a/cloudinit/UserDataHandler.py +++ b/cloudinit/UserDataHandler.py @@ -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 diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py index 85c6fd1b..6a1b46c5 100644 --- a/cloudinit/__init__.py +++ b/cloudinit/__init__.py @@ -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): 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:  | 
