~smoser/cloud-init/azure_dhcp

« back to all changes in this revision

Viewing changes to cloudinit/config/cc_write_files.py

  • Committer: Scott Moser
  • Date: 2016-06-21 18:37:23 UTC
  • Revision ID: smoser@ubuntu.com-20160621183723-uk8v7izrce090vcm
write_files: if no permissions are given, just use default without warn.

if no permissions were given in a write_files stanza, then
a warning would be emitted.

The fix here is just to special case handling of None.

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
 
80
80
 
81
81
def decode_perms(perm, default, log):
 
82
    if perm is None:
 
83
        return default
82
84
    try:
83
85
        if isinstance(perm, six.integer_types + (float,)):
84
86
            # Just 'downcast' it (if a float)