diff --git a/python/lib/cloudutils/serviceConfig.py b/python/lib/cloudutils/serviceConfig.py index 499e131e7da..afa49c88568 100755 --- a/python/lib/cloudutils/serviceConfig.py +++ b/python/lib/cloudutils/serviceConfig.py @@ -321,6 +321,33 @@ class cgroupConfig(serviceCfgBase): logging.debug(formatExceptionInfo()) return False +class nfsConfig(serviceCfgBase): + def __init__(self, syscfg): + super(nfsConfig, self).__init__(syscfg) + self.serviceName = "Nfs" + + def config(self): + try: + if not os.path.exists("/etc/nfsmount.conf"): + return True + + cfo = configFileOps("/etc/nfsmount.conf") + cfo.addEntry("AC", "False") + cfo.save() + + self.syscfg.svo.enableService("rpcbind") + self.syscfg.svo.stopService("rpcbind") + self.syscfg.svo.startService("rpcbind") + + self.syscfg.svo.enableService("nfs") + self.syscfg.svo.stopService("nfs") + self.syscfg.svo.startService("nfs") + + return True + except: + logging.debug(formatExceptionInfo()) + return False + class securityPolicyConfigUbuntu(serviceCfgBase): def __init__(self, syscfg): super(securityPolicyConfigUbuntu, self).__init__(syscfg) diff --git a/python/lib/cloudutils/syscfg.py b/python/lib/cloudutils/syscfg.py index 256991a93c7..8d5c63e4c28 100755 --- a/python/lib/cloudutils/syscfg.py +++ b/python/lib/cloudutils/syscfg.py @@ -133,6 +133,7 @@ class sysConfigAgentUbuntu(sysConfigAgent): networkConfigUbuntu(self), libvirtConfigUbuntu(self), firewallConfigUbuntu(self), + nfsConfig(self), cloudAgentConfig(self)] #it covers RHEL6/Fedora13/Fedora14 @@ -144,6 +145,7 @@ class sysConfigRedhat6(sysConfigAgentRedhatBase): networkConfigRedhat(self), libvirtConfigRedhat(self), firewallConfigAgent(self), + nfsConfig(self), cloudAgentConfig(self)] #It covers RHEL5/CentOS5, the mainly difference is that there is no cgroup