summaryrefslogtreecommitdiff
path: root/cloudinit/distros/__init__.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-09-30 13:47:00 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-09-30 13:47:00 -0700
commite2b85e2087b796c7a130ee20f688dbd5d161739f (patch)
tree7717c4549c419f639573d31e2cd7f10049315b5d /cloudinit/distros/__init__.py
parent9a252b3a41ad757587cba729b31079c04b253faa (diff)
downloadvyos-cloud-init-e2b85e2087b796c7a130ee20f688dbd5d161739f.tar.gz
vyos-cloud-init-e2b85e2087b796c7a130ee20f688dbd5d161739f.zip
Ensure that the include dir starts the line
and is not a part of a comment or other part of the line.
Diffstat (limited to 'cloudinit/distros/__init__.py')
-rw-r--r--cloudinit/distros/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index 500147c6..cdae1add 100644
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -305,10 +305,10 @@ class Distro(object):
found_include = False
for line in sudoers_contents.splitlines():
line = line.strip()
- mtch = re.search(r"#includedir\s+(.*)$", line)
- if not mtch:
+ include_match = re.search(r"^#includedir\s+(.*)$", line)
+ if not include_match:
continue
- included_dir = mtch.group(1).strip()
+ included_dir = include_match.group(1).strip()
if not included_dir:
continue
included_dir = os.path.abspath(included_dir)