~harlowja/cloud-init/none-ds

Viewing all changes in revision 603.

  • Committer: Scott Moser
  • Date: 2012-07-12 19:43:35 UTC
  • Revision ID: smoser@ubuntu.com-20120712194335-zir95vfcy14hbpu3
load_yaml: if conversion fails, but string is empty, return default

the problem sovled here is that most callers of yaml_load do not pass
'None' as a allowed type.  I didn't want to change all the callers.

If the yaml.safe_load ended up being None we were raising a TypeError
and that was getting logged (meaning output to console).  Even though
the this was not really bad.

So, if the type is not in the list, *and* it is not empty, then log
exception.  If it in the list and empty, just debug.

empty input was occurring when cloud-config was empty (no user-data)

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: