From 36c406df9d8e86abc64acbf2c2dfeeabfa11c8bf Mon Sep 17 00:00:00 2001 From: Harish S Date: Fri, 11 Nov 2016 11:48:22 +0530 Subject: [PATCH] Fix nfs.py: nfs-server for Ubuntu nfs service Replaced nfs-server as service name for handling nfs service in ubuntu Signed-off-by: Harish S --- virttest/nfs.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/virttest/nfs.py b/virttest/nfs.py index 2f7e2810ad..4591aefe05 100644 --- a/virttest/nfs.py +++ b/virttest/nfs.py @@ -9,6 +9,7 @@ from avocado.utils import path from avocado.utils import process +from avocado.utils import distro from avocado.core import exceptions from . import utils_misc @@ -152,12 +153,16 @@ def __init__(self, params): path.find_command("mount") self.mk_mount_dir = False self.unexportfs_in_clean = False + distro_details = distro.detect() if params.get("setup_local_nfs") == "yes": self.nfs_setup = True path.find_command("service") path.find_command("exportfs") - self.nfs_service = service.Factory.create_service("nfs") + if distro_details.name == 'Ubuntu': + self.nfs_service = service.Factory.create_service("nfs-server") + else: + self.nfs_service = service.Factory.create_service("nfs") self.rpcbind_service = service.Factory.create_service("rpcbind") self.export_dir = (params.get("export_dir") or