Set standard mode for systemd generated unit files

There isn't any secret in the container unit file, so we can use
the systemd standard mode (0644).

Change-Id: If1006ea9b6db89c4a64d632c1bd5bf2538beb2f1
This commit is contained in:
Cédric Jeanneret 2018-10-08 13:10:14 +02:00
parent fd01df5c5c
commit 133bb38368
2 changed files with 2 additions and 2 deletions

View File

@ -37,7 +37,7 @@ class TestUtilsSystemd(base.TestCase):
self.assertIn('Wants=something.service', unit)
self.assertIn('Restart=always', unit)
self.assertIn('ExecStop=/usr/bin/podman stop -t 15 my_app', unit)
mock_chmod.assert_has_calls([mock.call(sysd_unit_f, 448)])
mock_chmod.assert_has_calls([mock.call(sysd_unit_f, 420)])
mock_subprocess_call.assert_has_calls([
mock.call(['systemctl', 'enable', '--now', container]),

View File

@ -54,7 +54,7 @@ def service_create(container, cconfig, sysdir='/etc/systemd/system/'):
'stop_grace_period': stop_grace_period,
}
with open(sysd_unit_f, 'w') as unit_file:
os.chmod(unit_file.name, 0o700)
os.chmod(unit_file.name, 0o644)
unit_file.write("""[Unit]
Description=%(name)s container
After=paunch-container-shutdown.service