diff options
author | Scott Moser <smoser@ubuntu.com> | 2011-01-24 18:42:58 +0000 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2011-01-24 18:42:58 +0000 |
commit | 17ce079fa5a1f3dc2987ef32ff5600c13191ef16 (patch) | |
tree | dd18aa4afe763ba98102892f0ca79cbb44624116 /cloudinit | |
parent | f1ff91de6193404f544708fa94d7f8508228a98d (diff) | |
download | vyos-cloud-init-17ce079fa5a1f3dc2987ef32ff5600c13191ef16.tar.gz vyos-cloud-init-17ce079fa5a1f3dc2987ef32ff5600c13191ef16.zip |
cloudinit/__init__.py: fixes to initfs
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/__init__.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py index 12bd0fe1..f9b20bb0 100644 --- a/cloudinit/__init__.py +++ b/cloudinit/__init__.py @@ -88,6 +88,7 @@ def logging_set_from_cfg(cfg, logfile=None): if not len(log_cfgs): sys.stderr.write("Warning, no logging configured\n") + return for logcfg in log_cfgs: try: @@ -495,15 +496,17 @@ 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: - fp = open(def_log_file,"ab") + log_file = cfg['def_log_file'] + fp = open(log_file,"ab") fp.close() - if 'syslog_fix_perms' in cfg: + if log_file and 'syslog' in cfg: perms = cfg['syslog'] (u,g) = perms.split(':',1) if u == "-1" or u == "None": u = None if g == "-1" or g == "None": g = None - util.chownbyname(def_log_file, u, g) + util.chownbyname(log_file, u, g) def purge_cache(): try: |