diff options
author | Scott Moser <smoser@ubuntu.com> | 2011-01-24 14:03:01 -0500 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2011-01-24 14:03:01 -0500 |
commit | b9b0a79b5a1b142b9e1176d64f294cf9c9f84157 (patch) | |
tree | 35e2bf3d87a451fdb1c87b8cbfa1216e46813126 /cloudinit/__init__.py | |
parent | 9ebce731fe86e534ecb2bedca6dea27ce5179f44 (diff) | |
parent | 0b7f896201348ab791e89bb9f736d62a2941c14d (diff) | |
download | vyos-cloud-init-b9b0a79b5a1b142b9e1176d64f294cf9c9f84157.tar.gz vyos-cloud-init-b9b0a79b5a1b142b9e1176d64f294cf9c9f84157.zip |
merge in fixes to get to functioning point
Diffstat (limited to 'cloudinit/__init__.py')
-rw-r--r-- | cloudinit/__init__.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py index 12bd0fe1..d5180c05 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: @@ -483,7 +484,7 @@ class CloudInit: # reference, but did not have a cloudinit handle # (ie, no cloudinit.get_cpath()) def get_cpath(self,name=None): - return(get_cpath,name) + return(get_cpath(name)) def initfs(): @@ -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: |