diff options
| author | Scott Moser <smoser@ubuntu.com> | 2015-03-04 17:00:16 -0500 |
|---|---|---|
| committer | Scott Moser <smoser@ubuntu.com> | 2015-03-04 17:00:16 -0500 |
| commit | 068ee3d324350fd998e2a27e5be2991ea9bab52f (patch) | |
| tree | f7a1e0f8a2dc15e5555a3b97982c0475ec1e09dd /cloudinit/stages.py | |
| parent | c808b84f1f6cdfe090a18b759a602eb504f36026 (diff) | |
| parent | e7cce1a06429813b8d2acc87e6609671d39a3254 (diff) | |
| download | vyos-cloud-init-068ee3d324350fd998e2a27e5be2991ea9bab52f.tar.gz vyos-cloud-init-068ee3d324350fd998e2a27e5be2991ea9bab52f.zip | |
pull in 'snappy' support
This allows config to disable some of the config modules that were
failing and logging WARN on snapy. Also adds the snappy module
and changes the syslog perms to take a list of user:groups rather
than just a single.
LP: #1428139
Diffstat (limited to 'cloudinit/stages.py')
| -rw-r--r-- | cloudinit/stages.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/cloudinit/stages.py b/cloudinit/stages.py index 45d64823..d28e765b 100644 --- a/cloudinit/stages.py +++ b/cloudinit/stages.py @@ -148,16 +148,25 @@ class Init(object): def _initialize_filesystem(self): util.ensure_dirs(self._initial_subdirs()) log_file = util.get_cfg_option_str(self.cfg, 'def_log_file') - perms = util.get_cfg_option_str(self.cfg, 'syslog_fix_perms') if log_file: util.ensure_file(log_file) - if perms: - u, g = util.extract_usergroup(perms) + perms = self.cfg.get('syslog_fix_perms') + if not perms: + perms = {} + if not isinstance(perms, list): + perms = [perms] + + error = None + for perm in perms: + u, g = util.extract_usergroup(perm) try: util.chownbyname(log_file, u, g) - except OSError: - util.logexc(LOG, "Unable to change the ownership of %s to " - "user %s, group %s", log_file, u, g) + return + except OSError as e: + error = e + + LOG.warn("Failed changing perms on '%s'. tried: %s. %s", + log_file, ','.join(perms), error) def read_cfg(self, extra_fns=None): # None check so that we don't keep on re-loading if empty |
