From e2b85e2087b796c7a130ee20f688dbd5d161739f Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Sun, 30 Sep 2012 13:47:00 -0700 Subject: Ensure that the include dir starts the line and is not a part of a comment or other part of the line. --- cloudinit/distros/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cloudinit/distros') 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) -- cgit v1.2.3