Control the nfs service correctly on rpm-based systems

This fixes issue #11020

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit 2e4d884fda)
This commit is contained in:
Andrew Schoen 2015-03-04 08:57:03 -06:00
parent 7402d5f1a9
commit d2b52d977b

View File

@ -188,7 +188,7 @@ def _setup_nfs_mount(remote, client, mount_dir):
if remote.os.package_type == "deb":
remote.run(args=['sudo', 'service', 'nfs-kernel-server', 'restart'])
else:
remote.run(args=['sudo', 'systemctl', 'nfs', 'restart'])
remote.run(args=['sudo', 'systemctl', 'restart', 'nfs'])
def _teardown_nfs_mount(remote, client):
@ -205,7 +205,7 @@ def _teardown_nfs_mount(remote, client):
])
else:
remote.run(args=[
'sudo', 'systemctl', 'nfs', 'stop'
'sudo', 'systemctl', 'stop', 'nfs'
])
log.info("Unmounting exported directory...")
remote.run(args=[
@ -226,7 +226,7 @@ def _teardown_nfs_mount(remote, client):
])
else:
remote.run(args=[
'sudo', 'systemctl', 'nfs', 'start'
'sudo', 'systemctl', 'start', 'nfs'
])