]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
clock: handle different service names
authorDan Mick <dan.mick@redhat.com>
Fri, 13 Jan 2017 22:49:05 +0000 (14:49 -0800)
committerDan Mick <dan.mick@redhat.com>
Fri, 3 Mar 2017 21:25:49 +0000 (13:25 -0800)
Restarting ntpd involves two different service names (thanks
again, distro maintainers, much appreciated)

Signed-off-by: Dan Mick <dan.mick@redhat.com>
teuthology/task/clock.py

index bbfedffba4da25de6cfab9dcb1d3912848546b4b..0af18495a4e7623f4474de2f8de0b9232bd19035 100644 (file)
@@ -38,9 +38,11 @@ def task(ctx, config):
             if l.startswith('server')
         ]
         os.remove(ntpconf)
+        # CentOS calls it ntpd, Xenial/Trusty are ntp.  Thanks guys.
         args = [
-            'sudo',
-            'service', 'ntp', 'stop',
+            'sudo', 'service', 'ntp', 'stop',
+            run.Raw('||'),
+            'sudo', 'service', 'ntpd', 'stop',
             run.Raw(';'),
             'sudo',
             'ntpdate',
@@ -48,8 +50,9 @@ def task(ctx, config):
         args.extend(servers)
         args.extend([
             run.Raw(';'),
-            'sudo',
-            'service', 'ntp', 'start',
+            'sudo', 'service', 'ntp', 'start',
+            run.Raw('||'),
+            'sudo', 'service', 'ntpd', 'start',
             run.Raw(';'),
             'PATH=/usr/bin:/usr/sbin',
             'ntpdc', '-p',