#coding:utf-8
import textwrap
class Modules(object):
    """
    Configure node networks.
    """
    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):

        # network   --bootproto=static 
        #           --device=eth0 
        #           --gateway=192.168.199.1 
        #           --ip=192.168.199.155 
        #           --nameserver=192.168.199.1 
        #           --netmask=255.255.255.0 
        #           --ipv6=auto --activate
        #           --hostname=cluster

        network = []
        network.append(self.__help__)
        #network.append('network --bootproto=static --hostname=%s --activate' % args)
        network.append('network --hostname=%s' % args)
        self.cmd.ks.addMain(network)

    def __repr__(self):
        return "kickstart-network"
