From: Thierry Parmentelat Date: Fri, 25 May 2018 10:30:19 +0000 (+0200) Subject: when start/stopping services on f>=14, need a patch that was originally available... X-Git-Tag: tests-6.0-5~17 X-Git-Url: http://git.onelab.eu/?p=tests.git;a=commitdiff_plain;h=3d2d8bcf5cff165980b8267928de59a04c1de52a when start/stopping services on f>=14, need a patch that was originally available for f14 only --- diff --git a/system/TestPlc.py b/system/TestPlc.py index 4e90d13..b6f211f 100644 --- a/system/TestPlc.py +++ b/system/TestPlc.py @@ -798,8 +798,13 @@ class TestPlc: return self.start_stop_service(service, 'stop') def start_stop_service(self, service, start_or_stop): - "utility to start/stop a service with the special trick for f14" - if self.options.fcdistro != 'f14': + "utility to start/stop a service with the special trick starting with f14" + has_systemctl = False + if self.options.fcdistro[0] == 'f': + number = int(self.options.fcdistro[1:]) + if number >= 14: + has_systemctl = True + if not has_systemctl: return self.run_in_guest("service {} {}".format(service, start_or_stop)) == 0 else: # patch /sbin/service so it does not reset environment