service_create: invert order for systemctl

Let's run daemon-reload before trying to enable the services, to make
sure systemd knows about the new unit file.

Change-Id: I9962c9ffa558f443f90c422ec811dc00f9d116a3
This commit is contained in:
Emilien Macchi 2018-12-06 16:21:51 -05:00
parent aa42360b85
commit 0746273753
2 changed files with 2 additions and 2 deletions

View File

@ -41,8 +41,8 @@ class TestUtilsSystemd(base.TestCase):
mock_chmod.assert_has_calls([mock.call(sysd_unit_f, 420)])
mock_subprocess_call.assert_has_calls([
mock.call(['systemctl', 'enable', '--now', service]),
mock.call(['systemctl', 'daemon-reload']),
mock.call(['systemctl', 'enable', '--now', service]),
])
os.rmdir(tempdir)

View File

@ -78,8 +78,8 @@ ExecStop=/usr/bin/podman stop -t %(stop_grace_period)s %(name)s
KillMode=process
[Install]
WantedBy=multi-user.target""" % s_config)
subprocess.call(['systemctl', 'enable', '--now', service])
subprocess.call(['systemctl', 'daemon-reload'])
subprocess.call(['systemctl', 'enable', '--now', service])
def service_delete(container, log=None):