summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/distros/__init__.py1
-rw-r--r--tests/unittests/test_distros/test_generic.py2
2 files changed, 2 insertions, 1 deletions
diff --git a/cloudinit/distros/__init__.py b/cloudinit/distros/__init__.py
index e724a418..6a684b89 100644
--- a/cloudinit/distros/__init__.py
+++ b/cloudinit/distros/__init__.py
@@ -429,6 +429,7 @@ class Distro(object):
msg = "Can not create sudoers rule addition with type %r"
raise TypeError(msg % (util.obj_name(rules)))
content = "\n".join(lines)
+ content += "\n" # trailing newline
self.ensure_sudo_dir(os.path.dirname(sudo_file))
if not os.path.exists(sudo_file):
diff --git a/tests/unittests/test_distros/test_generic.py b/tests/unittests/test_distros/test_generic.py
index 3ca769b4..7befb8c8 100644
--- a/tests/unittests/test_distros/test_generic.py
+++ b/tests/unittests/test_distros/test_generic.py
@@ -55,7 +55,7 @@ class TestGenericDistro(helpers.FilesystemMockingTestCase):
# Make a temp directoy for tests to use.
self.tmp = self.makeDir()
- def _write_load_sudoers(self, user, rules):
+ def _write_load_sudoers(self, _user, rules):
cls = distros.fetch("ubuntu")
d = cls("ubuntu", {}, None)
os.makedirs(os.path.join(self.tmp, "etc"))