From: Yan, Zheng Date: Tue, 30 Jun 2015 03:34:13 +0000 (+0800) Subject: tasks/nfs: make sure NFS kernel server is started X-Git-Tag: 1.1.0~847^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9ff7a5c677731fb52dfd5a8f0ffaf835c07a1259;p=teuthology.git tasks/nfs: make sure NFS kernel server is started Fixes: #9994 Signed-off-by: Yan, Zheng --- diff --git a/teuthology/task/knfsd.py b/teuthology/task/knfsd.py index 96f501717..100671d82 100644 --- a/teuthology/task/knfsd.py +++ b/teuthology/task/knfsd.py @@ -9,6 +9,17 @@ from teuthology import misc as teuthology log = logging.getLogger(__name__) +def get_nfsd_args(remote, cmd): + args=[ + 'sudo', + 'service', + 'nfs', + cmd, + ] + if remote.os.package_type == 'deb': + args[2] = 'nfs-kernel-server' + return args + @contextlib.contextmanager def task(ctx, config): """ @@ -104,6 +115,10 @@ def task(ctx, config): '{MNT}'.format(MNT=mnt), ], ) + """ + Start NFS kernel server + """ + remote.run( args=get_nfsd_args(remote, 'restart') ) args=[ 'sudo', "exportfs", @@ -144,27 +159,8 @@ def task(ctx, config): check_status=False ) finally: - remote.run( - args=[ - 'sudo', - 'exportfs', - '-au', - ], - ) - remote.run( - args=[ - 'sudo', - 'rpc.nfsd', - '0', - ], - ) - remote.run( - args=[ - 'sudo', - 'exportfs', - '-f', - ], - ) + log.debug('Stopping NFS server on client.{id}...'.format(id=id_)) + remote.run( args=get_nfsd_args(remote, 'stop') ) log.debug('Syncing client client.{id}'.format(id=id_)) remote.run( args=[