From fdc7a9c7bd4fe47ab1ac93971d9d40f064938462 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 27 Jan 2011 10:27:54 -0500 Subject: take correct action if def_log_file and syslog_fix_perms are empty --- cloudinit/__init__.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'cloudinit/__init__.py') diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py index acedf77e..cbdf2271 100644 --- a/cloudinit/__init__.py +++ b/cloudinit/__init__.py @@ -482,13 +482,12 @@ def initfs(): util.ensure_dirs(dlist) cfg = util.get_base_cfg(system_config,cfg_builtin,parsed_cfgs) - log_file = None - if 'def_log_file' in cfg: - log_file = cfg['def_log_file'] + log_file = util.get_cfg_option_str(cfg, 'def_log_file', None) + perms = util.get_cfg_option_str(cfg, 'syslog_fix_perms', None) + if log_file: fp = open(log_file,"ab") fp.close() - if log_file and 'syslog_fix_perms' in cfg: - perms = cfg['syslog_fix_perms'] + if log_file and perms: (u,g) = perms.split(':',1) if u == "-1" or u == "None": u = None if g == "-1" or g == "None": g = None -- cgit v1.2.3