diff options
author | Harm Weites <harm@weites.com> | 2014-08-08 19:23:56 +0000 |
---|---|---|
committer | Harm Weites <harm@weites.com> | 2014-08-08 19:23:56 +0000 |
commit | 019c90f07061adeda54173ea9afd7752cd11cd90 (patch) | |
tree | 9fbbd468e027c7300b51ac3f56df0d89ab997af5 /cloudinit/distros/freebsd.py | |
parent | 0ae8b2f5d1fda34f1efa50de8defd127a7907576 (diff) | |
download | vyos-cloud-init-019c90f07061adeda54173ea9afd7752cd11cd90.tar.gz vyos-cloud-init-019c90f07061adeda54173ea9afd7752cd11cd90.zip |
fix: Skip lines from /etc/rc.conf not matching the pattern key=value.
Diffstat (limited to 'cloudinit/distros/freebsd.py')
-rw-r--r-- | cloudinit/distros/freebsd.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cloudinit/distros/freebsd.py b/cloudinit/distros/freebsd.py index 1085185b..b4d841f8 100644 --- a/cloudinit/distros/freebsd.py +++ b/cloudinit/distros/freebsd.py @@ -72,6 +72,11 @@ class Distro(distros.Distro): conf = {} lines = util.load_file(self.rc_conf_fn).splitlines() for line in lines: + if not re.match(r'^(.+)=(.+)', line): + LOG.debug("Skipping line from /etc/rc.conf: %s", line) + continue + + # TODO: just use the matches please... tok = line.split('=') key = tok[0] val = re.sub(r'^"|"$', '', tok[1].rstrip()) |