#coding:utf-8
import time
import sunhpc
class Modules(object):
    """
    Configure sunhpc compute node services.
    """ 
    def __init__(self, command):
        self.cmd = command

    @property
    def __help__(self):
        info = """
        #==============================================================
        # %s
        #
        # module_path: %s
        # module_name: %s
        #==============================================================
        """ % (self.__doc__.strip(), self.__module__.strip(), self.__repr__())
        return info
        
    def run(self, args):

        #
        # self.cmd.ks.makefile
        #   args:
        #       text, type:list 
        #       name, type:file path
        #       mode, owner, perms, expr, quot
        # 

        content = [self.__help__]

        # Autofs 
        autofs_info = """
        sed -i 's/mount_nfs_default_protocol = 4/mount_nfs_default_protocol = 3/g' /etc/autofs.conf
        """
        content.append(autofs_info)

        self.cmd.ks.addPost(content)
    def __repr__(self):
        return "kickstart-services"
















