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:
parent
fd01df5c5c
commit
133bb38368
|
@ -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]),
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue