Update the elif block to only be true for versions below Debian 9.

This commit is contained in:
Gareth J. Greenaway 2018-08-06 14:56:24 -07:00 committed by Ch3LL
parent 848d583438
commit 3ce1b8a3c9
No known key found for this signature in database
GPG key ID: 132B55A7C13EFA73

View file

@ -127,7 +127,10 @@ class ServiceModuleTest(ModuleCase):
if tuple(self.run_function('grains.item', ['osrelease_info'])['osrelease_info']) == (14, 0o4) and not systemd:
# currently upstart does not have a mechanism to report if disabling a service fails if does not exist
self.assertTrue(self.run_function('service.disable', [srv_name]))
elif self.run_function('grains.item', ['osfullname'])['osfullname'] == 'Debian' and systemd:
elif self.run_function('grains.item', ['osfullname'])['osfullname'] == 'Debian' and \
self.run_function('grains.item', ['osmajorrelease'])['osmajorrelease'] < 9 and systemd:
# currently disabling a service via systemd that does not exist
# on Debian 8 results in a True return code
self.assertTrue(self.run_function('service.disable', [srv_name]))
else:
try: