From: Dan Mick Date: Fri, 13 Jan 2017 22:49:05 +0000 (-0800) Subject: clock: handle different service names X-Git-Tag: 1.1.0~453^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=907d7166e6626e3637972d0593d1761473b310bc;p=teuthology.git clock: handle different service names Restarting ntpd involves two different service names (thanks again, distro maintainers, much appreciated) Signed-off-by: Dan Mick --- diff --git a/teuthology/task/clock.py b/teuthology/task/clock.py index bbfedffba..0af18495a 100644 --- a/teuthology/task/clock.py +++ b/teuthology/task/clock.py @@ -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',